Skip to content

Stop thumbnail helpers when their images are discarded - #117

Draft
k-kostin wants to merge 2 commits into
omacom:thumbnail-rowsfrom
k-kostin:codex/cancel-thumbnail-requests
Draft

k-kostin wants to merge 2 commits into
omacom:thumbnail-rowsfrom
k-kostin:codex/cancel-thumbnail-requests

Conversation

@k-kostin

Copy link
Copy Markdown

Summary

Leaving a folder or scrolling past its tiles cancels their image requests, but helpers already running keep their workers until they finish. Pass each response's cancellation flag through the existing thumbnail pipeline, reusing #67's process cleanup.

discard image → cancel its request → stop its helper session → serve the next image

Stacked on #67, which builds on #66. This targets thumbnail-rows so the diff contains only the cancellation change. Once #67 lands, I will rebase onto main, repeat the checks and retarget this PR before marking it ready.

Thanks to @thisisgm and @dhh for the thumbnailer work in #67. No dependency is added.

Evidence

  • Before: thumbnailsStopWorkWhenItsImagesGoAway needs 2.5 seconds on the unchanged Thumbnails: pictures in rows, sturdier thumbnailers #67 head, failing its 1-second deadline. After: the same QML regression passes.
  • Five new cases cover discarded QML images, cancellation of video helpers and both PDF helper paths, stopping descendants, suppressing a cancelled PDF's fallback, retrying the unchanged file, and preserving an image another tile still needs.
  • Ten paired runs with six controlled slow helpers: follow-up image median 2514 → 101 ms, p95 2525 → 111 ms. This measures the fixture's queue delay, not general application startup.
  • The real Backend/FolderGrid, F3D and a 46.8 MiB STL, six pairs per scenario: navigating from 24 STL entries to a PNG folder gives 636 → 89 ms median to Image.Ready; jumping to the last of 600 entries gives 1351 → 782 ms. The entries are private links to the same model. These run offscreen with an empty application cache and warm OS page cache; physical display latency is not measured.
  • Release build and git diff --check pass. The complete local suite with the Qt image plugins from CI's dependency list reports 220 passed, 0 failed. With this desktop's additional KDE RAW plugin, 219 pass and 1 fails: previewerPicksAViewerForEachType expects CR2 to use a thumbnail although that plugin can decode it. The unchanged parent has the same failure (214 pass, 1 fail). This is local validation, not a claim that GitHub CI has run.

Merge Danger

Door: two-way. Reverting restores the old scheduling behavior; no data migration.

Blast Radius: thumbnails. Cancellation applies to external helpers. In-process decoding still finishes its current call before observing cancellation.

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