fix: repair notification system (broken type assertion + wrong PocketBase filter quotes)
- Add bookstore.NotificationStore interface and wire it directly to *storage.Store in Dependencies, bypassing the Asynq wrapper that caused Producer.(*storage.Store) to fail with a 500 on every notification endpoint when Redis is configured - Replace s.deps.Producer.(*storage.Store) type assertion in all 5 notification handlers with s.deps.NotificationStore (nil-safe, always works) - Fix PocketBase filter single-quote bug in ListNotifications, ClearAllNotifications, and MarkAllNotificationsRead (PocketBase requires double quotes for string values)
This commit is contained in:
@@ -247,3 +247,14 @@ type ImportFileStore interface {
|
||||
// GetImportChapters retrieves the pre-parsed chapters JSON.
|
||||
GetImportChapters(ctx context.Context, key string) ([]byte, error)
|
||||
}
|
||||
|
||||
// NotificationStore manages per-user in-app notifications.
|
||||
// Always wired directly to the concrete *storage.Store so it works
|
||||
// regardless of whether the Asynq task-queue wrapper is in use.
|
||||
type NotificationStore interface {
|
||||
ListNotifications(ctx context.Context, userID string, limit int) ([]map[string]any, error)
|
||||
MarkNotificationRead(ctx context.Context, id string) error
|
||||
MarkAllNotificationsRead(ctx context.Context, userID string) error
|
||||
DeleteNotification(ctx context.Context, id string) error
|
||||
ClearAllNotifications(ctx context.Context, userID string) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user