Skip to content

Surface skipped board images after indexing#337

Merged
lstein merged 2 commits into
masterfrom
lstein/feature/surface-skipped-board-images
Jun 16, 2026
Merged

Surface skipped board images after indexing#337
lstein merged 2 commits into
masterfrom
lstein/feature/surface-skipped-board-images

Conversation

@lstein

@lstein lstein commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Background

A user pointed an InvokeAI board album at a board the InvokeAI gallery reports as 242 images, but the album indexed only 240. The cause: 2 image names listed in InvokeAI's database have no corresponding file on disk under <root>/outputs/images/. _resolve_board_album_files already skipped them and logged a server-side warning — but nothing reached the UI, so the discrepancy was invisible. (The underlying missing-file situation is an InvokeAI-side data issue the user is handling separately; this PR makes PhotoMap explain the gap.)

What this does

Surfaces the skip as a non-fatal completion notice, end to end:

  • progress.pyProgressInfo gains warning_message. Because the per-phase start_operation calls recreate ProgressInfo mid-run, the notice is recorded ahead of time via a separate set_completion_warning(...) channel and folded into the COMPLETED status atomically inside complete_operation (so any poll that sees completed also sees the warning — no race). Consumed on completion and cleared on remove_progress, so a clean re-run never inherits a stale notice.
  • index.py_resolve_board_album_files now returns (existing, missing). The background task records "N of M image(s) listed by InvokeAI were not found on disk and were skipped." when missing > 0, and clears it otherwise. ProgressResponse exposes warning_message.
  • album-manager.js — the completion status shows the notice in orange, and it persists under the card's index-status line (via a per-album indexWarnings map) after the transient progress UI is gone.

Bonus: a related blind spot

get_image_files' explicit-file-list branch (used by board albums) silently dropped sub-threshold/unreadable images, while the directory-scan path logs "Skipped N image(s) under …px". The list branch now counts and logs them too, so future indexed-vs-source mismatches aren't a mystery.

Testing

  • Backend (441 passed): new test_progress.py cases for the warning folding in / surviving phase restarts / clearing on reuse; new test_invokeai_board_index.py cases asserting a ghost board entry produces "1 of 5 … not found on disk" on the completed run (and that a complete board carries no warning).
  • Frontend (383 passed): new cases for the completed-status warning rendering and the persistent card note.
  • ruff, eslint, and prettier --check all clean.

🤖 Generated with Claude Code

lstein and others added 2 commits June 15, 2026 21:20
When an InvokeAI board album indexes fewer images than the board reports
(commonly because some names listed in InvokeAI's DB have no file on
disk), the discrepancy was invisible: _resolve_board_album_files logged a
server-side warning, but nothing reached the UI, so the album silently
showed e.g. 240 of 242 images.

Surface it as a non-fatal completion notice:
- ProgressInfo gains a warning_message, set via a pending-warning channel
  (set_completion_warning) that survives the per-phase start_operation
  resets and is folded into the COMPLETED status atomically by
  complete_operation. Exposed through ProgressResponse.
- _resolve_board_album_files now returns the missing count; the background
  task records "N of M image(s) listed by InvokeAI were not found on disk
  and were skipped" (and clears it on a clean re-run).
- The frontend shows the notice on completion (orange) and persists it
  under the card's index-status line via a per-album indexWarnings map.

Also close a related blind spot: get_image_files' explicit-list branch
(used by board albums) now counts and logs sub-threshold/unreadable
images, mirroring the directory-scan path instead of dropping them
silently.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lstein lstein enabled auto-merge (squash) June 16, 2026 22:07
@lstein lstein merged commit d8656c1 into master Jun 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant