Report the latest failed suggestion batch on the deck
The deck reported only a pending or running batch, so a Discover page opened after a batch failed (or was interrupted by a restart) had no job to follow and showed "All caught up" or the remaining cards with no error. GET /api/v1/suggestions/deck now also returns failed_batch: the newest batch when it failed, read in the same snapshot after orphaned batches are failed, so at most one of active_batch and failed_batch is set and a later batch supersedes the failure. The page follows the failed batch's job like the active one, so its failure shows with the existing Retry, which asks for a new batch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -78,6 +78,9 @@ type Querier interface {
|
||||
// Returns sql.ErrNoRows until the row exists.
|
||||
GetIntegrationsGoogle(ctx context.Context) (IntegrationsGoogle, error)
|
||||
GetJob(ctx context.Context, id string) (Job, error)
|
||||
// The newest batch, whatever its status. Returns sql.ErrNoRows when there
|
||||
// is none.
|
||||
GetLatestSuggestionBatch(ctx context.Context) (SuggestionBatch, error)
|
||||
GetPhoto(ctx context.Context, id string) (Photo, error)
|
||||
// Finds stored image bytes by content hash. The schema does not make sha256
|
||||
// unique, so the earliest-created (lowest id) match is returned.
|
||||
|
||||
Reference in New Issue
Block a user