Search full view: photo grid tiles show no thumbnails (e2e search fails consistently) #224

Closed
opened 2026-09-27 10:17:19 +00:00 by kayg · 6 comments
Owner

Gates on dev 65265f87: apps/web/e2e/search.mjs fails every run at 'await page.locator(".grid .tile img").first().waitFor()' (expanded search view, query 'atlas', photo grid). apps/web/src/lib/search/PhotoGrid.svelte renders only when the result has a content hash (else a glyph). Find why photo results in the full view come without a hash or without a loadable thumbnail: suspects are the #195 search authorization change (fields dropped from results, or thumbnails now refused for this route), the #218/#178 search merges, or thumbnail generation timing with the local media sandbox (#209). Fix the cause, keep the e2e assertion strict, and add a unit/API test that photo search results carry what the grid needs. Commit per step.

Gates on dev 65265f87: apps/web/e2e/search.mjs fails every run at 'await page.locator(".grid .tile img").first().waitFor()' (expanded search view, query 'atlas', photo grid). apps/web/src/lib/search/PhotoGrid.svelte renders <img> only when the result has a content hash (else a glyph). Find why photo results in the full view come without a hash or without a loadable thumbnail: suspects are the #195 search authorization change (fields dropped from results, or thumbnails now refused for this route), the #218/#178 search merges, or thumbnail generation timing with the local media sandbox (#209). Fix the cause, keep the e2e assertion strict, and add a unit/API test that photo search results carry what the grid needs. Commit per step.
Author
Owner

Started #224 on branch job/search-thumbs, based on dev SHA 2a379b185677fd6d85980900c5e757af990d9527. I am reproducing the reported search e2e failure before implementation changes.

Started #224 on branch `job/search-thumbs`, based on dev SHA `2a379b185677fd6d85980900c5e757af990d9527`. I am reproducing the reported search e2e failure before implementation changes.
Author
Owner

Baseline evidence: unmodified apps/web/e2e/search.mjs reaches the expanded atlas photo grid and then fails after 20 seconds waiting for .grid .tile img. The photo grid tiles exist, so the failure is at thumbnail resolution/rendering. I am checking the search path, Files stat, and thumbnail response next.

Baseline evidence: unmodified `apps/web/e2e/search.mjs` reaches the expanded `atlas` photo grid and then fails after 20 seconds waiting for `.grid .tile img`. The photo grid tiles exist, so the failure is at thumbnail resolution/rendering. I am checking the search path, Files `stat`, and thumbnail response next.
Author
Owner

Finding: all five atlas-*.jpg search hits contain path; Files stat returns 200 and a content hash for each, so search fields and path authorization work. Each stat reports has_thumbnail: false, and each authorized /api/v1/files/thumb/<hash>?s=256 request returns 404. The problem is thumbnail generation or publication, not search-result authorization.

Finding: all five `atlas-*.jpg` search hits contain `path`; Files `stat` returns 200 and a content hash for each, so search fields and path authorization work. Each stat reports `has_thumbnail: false`, and each authorized `/api/v1/files/thumb/<hash>?s=256` request returns 404. The problem is thumbnail generation or publication, not search-result authorization.
Author
Owner

Root cause: apps/web/e2e/search.mjs starts its own server and omits the existing mediaSandboxEnv() from apps/web/e2e/harness.mjs. The shared helper builds the local calternal-media-sandbox and adds its directory to PATH; without it, files.thumbnail cannot start the decoder and no thumbnail is published. tests/adversarial/test-media-sandbox.sh passes when it sets that environment. I am wiring the search runner to the shared helper.

Root cause: `apps/web/e2e/search.mjs` starts its own server and omits the existing `mediaSandboxEnv()` from `apps/web/e2e/harness.mjs`. The shared helper builds the local `calternal-media-sandbox` and adds its directory to `PATH`; without it, `files.thumbnail` cannot start the decoder and no thumbnail is published. `tests/adversarial/test-media-sandbox.sh` passes when it sets that environment. I am wiring the search runner to the shared helper.
Author
Owner

Fixed Forgejo #224. The search E2E server now receives the media sandbox environment from the shared E2E harness. This makes the Files thumbnail route available to search results. The E2E keeps the image assertion strict and checks that each image decoded successfully. The Photos provider test also asserts that a result includes the stable relative photo path used for thumbnail lookup.

Root cause: apps/web/e2e/search.mjs started its own server without calling mediaSandboxEnv(). Search returned the photo paths and Files stat succeeded, but the thumbnail helper was unavailable, so the thumbnail route returned 404.

Files: apps/web/e2e/search.mjs; crates/plugins/photos/src/search.rs.

Commits:

  • cb0a5dba39fde4fd3fcf8e7c9c623cdb0af65a6d test(search): provide local media thumbnails in e2e
  • 7e2fd2de1d523e4c7927e4d43525d2e379023111 test(photos): require search hit path for thumbnail lookup

Gates:

  • cargo fmt --check: exit 0, no output.
  • cargo clippy --all-targets -- -D warnings: Finished dev profile [unoptimized + debuginfo] target(s) in 15m 45s (exit 0).
  • cargo test: exit 0. The shared sccache daemon had a stale TMPDIR on the first attempt; the successful full workspace run used env -u RUSTC_WRAPPER. Output included test result: ok. 41 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 30.93s for the server suite.
  • bun run check: svelte-check found 0 errors and 0 warnings (exit 0).
  • bun run test: Test Files 78 passed (78) and Tests 579 passed (579) (exit 0).
  • Search E2E: search e2e: ok.

Known gaps: Cargo's pre-existing ignored tests remain skipped, including tests that require pinned model files and isolated live-app processes.

Decision not specified in DESIGN.md: use the shared mediaSandboxEnv() in this E2E server and require decoded image dimensions in the strict assertion. This follows the existing harness contract and checks the behavior users need from thumbnails.

Final HEAD: 7e2fd2de1d523e4c7927e4d43525d2e379023111.

Fixed Forgejo #224. The search E2E server now receives the media sandbox environment from the shared E2E harness. This makes the Files thumbnail route available to search results. The E2E keeps the image assertion strict and checks that each image decoded successfully. The Photos provider test also asserts that a result includes the stable relative photo path used for thumbnail lookup. Root cause: `apps/web/e2e/search.mjs` started its own server without calling `mediaSandboxEnv()`. Search returned the photo paths and Files stat succeeded, but the thumbnail helper was unavailable, so the thumbnail route returned 404. Files: `apps/web/e2e/search.mjs`; `crates/plugins/photos/src/search.rs`. Commits: - `cb0a5dba39fde4fd3fcf8e7c9c623cdb0af65a6d` test(search): provide local media thumbnails in e2e - `7e2fd2de1d523e4c7927e4d43525d2e379023111` test(photos): require search hit path for thumbnail lookup Gates: - `cargo fmt --check`: exit 0, no output. - `cargo clippy --all-targets -- -D warnings`: `Finished `dev` profile [unoptimized + debuginfo] target(s) in 15m 45s` (exit 0). - `cargo test`: exit 0. The shared sccache daemon had a stale TMPDIR on the first attempt; the successful full workspace run used `env -u RUSTC_WRAPPER`. Output included `test result: ok. 41 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 30.93s` for the server suite. - `bun run check`: `svelte-check found 0 errors and 0 warnings` (exit 0). - `bun run test`: `Test Files 78 passed (78)` and `Tests 579 passed (579)` (exit 0). - Search E2E: `search e2e: ok`. Known gaps: Cargo's pre-existing ignored tests remain skipped, including tests that require pinned model files and isolated live-app processes. Decision not specified in DESIGN.md: use the shared `mediaSandboxEnv()` in this E2E server and require decoded image dimensions in the strict assertion. This follows the existing harness contract and checks the behavior users need from thumbnails. Final HEAD: `7e2fd2de1d523e4c7927e4d43525d2e379023111`.
kayg referenced this issue from a commit 2026-09-27 11:38:54 +00:00
Author
Owner

Merged in 1701cef5: search e2e uses mediaSandboxEnv() and asserts decoded thumbnails.

Merged in 1701cef5: search e2e uses mediaSandboxEnv() and asserts decoded thumbnails.
kayg closed this issue 2026-09-27 11:38:55 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#224
No description provided.