fix(mobile): handle image stream completion when no image is emitted#25984
fix(mobile): handle image stream completion when no image is emitted#25984mertalev merged 5 commits intoimmich-app:mainfrom
Conversation
|
@mertalev sorry for creating a new pr, seems I messed up something up with the branching in pr #25895 and included some other commits from another fix Also now after having an actual fix, and not some workaround like throwing an error, the title of the PR doesn't make any sense anymore. fix(mobile): fix image stream cancellation for multiple listeners |
|
Also @mertalev Another question, which does not really have anything to do with the issue but just in general: From |
There was a problem hiding this comment.
Pull request overview
This PR fixes a mobile image-loading race condition where opening an asset before its thumbnail finished loading could cause the full image to wait forever, by moving cancellation logic from widget disposal to ImageStream listener lifecycle.
Changes:
- Removed widget-driven
cancel()calls fromThumbnaildisposal to avoid canceling shared in-flight requests. - Updated cancellable image providers to cancel when the last ImageStream listener is removed (instead of waiting for completer disposal).
- Refactored
OneFramePlaceholderImageStreamCompleterto useaddOnLastListenerRemovedCallbackfor cancellation signaling.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| mobile/lib/presentation/widgets/images/thumbnail.widget.dart | Stops canceling image providers on widget dispose; relies on listener removal instead. |
| mobile/lib/presentation/widgets/images/thumb_hash_provider.dart | Wires cancellation to “last listener removed” on the stream completer. |
| mobile/lib/presentation/widgets/images/remote_image_provider.dart | Same cancellation wiring for remote thumb/full providers. |
| mobile/lib/presentation/widgets/images/local_image_provider.dart | Same cancellation wiring for local thumb/full providers. |
| mobile/lib/presentation/widgets/images/one_frame_multi_image_stream_completer.dart | Switches from onDisposed to addOnLastListenerRemovedCallback to trigger cancellation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mertalev
left a comment
There was a problem hiding this comment.
addOnLastListenerRemovedCallback was what this code used to use and I agree it's a cleaner approach, but it rarely gets called and when it does it's way too late. The Thumbnail widget canceling on dispose is a much more reliable way to actually cancel image requests.
…ved callback synchronous with removing the last listener
|
@mertalev Hm, just saw in the docs I have pushed another change, where we have a synchronous onLastListenerRemoved invocation. This should now have the same timing as the previous implementation where But if this is also not wanted, what else do you suggest?
The bug is really annoying, so it would be cool if we could find a fix :) because if you see a blurry image in the Gallery, and already know its the image you want to open, you currently still have to wait till the full thumbnail is shown or else this bug will happen. |
There was a problem hiding this comment.
There are many possible approaches here, like making the thumbnail widget not cancel on tap (though this also needs care since disposal happens a lot and doing expensive checks for this will slow things down), marking a request so it can only be canceled by a full-size provider and not a thumbnail provider, tweaking the initial stream / getInitialImage behavior, etc. I'm not sure which is the best approach, but this approach has a higher chance of performance regression than others.
mobile/lib/presentation/widgets/images/one_frame_multi_image_stream_completer.dart
Outdated
Show resolved
Hide resolved
… when only cache listener remains
…callback is invoked only once
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/immich-app/immich-machine-learning](https://github.com/immich-app/immich) | patch | `v2.5.5` → `v2.5.6` | | [ghcr.io/immich-app/immich-server](https://github.com/immich-app/immich) | patch | `v2.5.5` → `v2.5.6` | --- >⚠️ **Warning** > > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>immich-app/immich (ghcr.io/immich-app/immich-machine-learning)</summary> ### [`v2.5.6`](https://github.com/immich-app/immich/releases/tag/v2.5.6) [Compare Source](immich-app/immich@v2.5.5...v2.5.6) ##### v2.5.6 This patch release addresses the following issues - Fixed an issue where thumbnail generation runs every night when `full-size image generation` option is enabled. - Fixed an issue where iOS is slow to start in some cases. - Fixed an issue where Android device cannot delete asset using Free Up Space feature if it has more than a few thousand assets <!-- Release notes generated using configuration in .github/release.yml at v2.5.6 --> ##### 🐛 Bug fixes - fix: enhance album sorting functionality with order handling by [@​LeLunZ](https://github.com/LeLunZ) in [#​24816](immich-app/immich#24816) - fix: add missing translations for image editor by [@​michelheusschen](https://github.com/michelheusschen) in [#​25957](immich-app/immich#25957) - fix: image and video download complete notification shows "file\_name" by [@​romoisverycool](https://github.com/romoisverycool) in [#​25975](immich-app/immich#25975) - fix: user profile refetched each time on opening app dialog by [@​shenlong-tanwen](https://github.com/shenlong-tanwen) in [#​25992](immich-app/immich#25992) - fix: improve albums page load time on firefox by [@​michelheusschen](https://github.com/michelheusschen) in [#​26025](immich-app/immich#26025) - fix: reduce queue graph jitter and include paused count by [@​michelheusschen](https://github.com/michelheusschen) in [#​26023](immich-app/immich#26023) - fix(web): toast fixed location by [@​YarosMallorca](https://github.com/YarosMallorca) in [#​25966](immich-app/immich#25966) - fix: scroll jump when opening show & hide people by [@​michelheusschen](https://github.com/michelheusschen) in [#​25932](immich-app/immich#25932) - fix(web): display storage unit next to value instead of absolute positioning in admin user page by [@​K0lin](https://github.com/K0lin) in [#​25985](immich-app/immich#25985) - fix: iOS slow start by [@​alextran1502](https://github.com/alextran1502) in [#​26043](immich-app/immich#26043) - fix: profile dialog auto dismiss after opening on iPad by [@​alextran1502](https://github.com/alextran1502) in [#​26046](immich-app/immich#26046) - fix(web): prevent context menu from overflowing viewport by [@​ttpss930141011](https://github.com/ttpss930141011) in [#​26041](immich-app/immich#26041) - fix: slideshow setting dropdown overflow by [@​michelheusschen](https://github.com/michelheusschen) in [#​26066](immich-app/immich#26066) - fix: free up space using small batch size to reliably work on Android by [@​alextran1502](https://github.com/alextran1502) in [#​26047](immich-app/immich#26047) - fix(web): removing a person in an asset, doesn't remove the asset in … by [@​dolfje](https://github.com/dolfje) in [#​26068](immich-app/immich#26068) - fix(mobile): handle image stream completion when no image is emitted by [@​LeLunZ](https://github.com/LeLunZ) in [#​25984](immich-app/immich#25984) - fix: evict image from cache on error during image loading by [@​LeLunZ](https://github.com/LeLunZ) in [#​26078](immich-app/immich#26078) - fix(server): thumbnail queueing by [@​mertalev](https://github.com/mertalev) in [#​26077](immich-app/immich#26077) - fix: create face exif orientation handling by [@​bwees](https://github.com/bwees) in [#​26108](immich-app/immich#26108) - fix(web): refresh text by [@​jrasm91](https://github.com/jrasm91) in [#​26071](immich-app/immich#26071) - fix: correctly cancel select all assets by [@​michelheusschen](https://github.com/michelheusschen) in [#​26067](immich-app/immich#26067) - fix: person thumbnail generation on edited assets by [@​bwees](https://github.com/bwees) in [#​26112](immich-app/immich#26112) - fix: local date time group fall back by [@​alextran1502](https://github.com/alextran1502) in [#​26110](immich-app/immich#26110) ##### 📚 Documentation - feat(docs): version policy by [@​mmomjian](https://github.com/mmomjian) in [#​25979](immich-app/immich#25979) - feat(deployment): rootless compose file by [@​mmomjian](https://github.com/mmomjian) in [#​25931](immich-app/immich#25931) - docs: update ml-hardware-acceleration.md by [@​cmrtdev](https://github.com/cmrtdev) in [#​25755](immich-app/immich#25755) ##### 🌐 Translations - chore(web): update translations by [@​weblate](https://github.com/weblate) in [#​25947](immich-app/immich#25947) ##### New Contributors - [@​ttpss930141011](https://github.com/ttpss930141011) made their first contribution in [#​26041](immich-app/immich#26041) - [@​dolfje](https://github.com/dolfje) made their first contribution in [#​26068](immich-app/immich#26068) - [@​cmrtdev](https://github.com/cmrtdev) made their first contribution in [#​25755](immich-app/immich#25755) - [@​nicosemp](https://github.com/nicosemp) made their first contribution in [#​25599](immich-app/immich#25599) **Full Changelog**: <immich-app/immich@v2.5.5...v2.5.6> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45Ni4yIiwidXBkYXRlZEluVmVyIjoiNDIuOTYuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: Renovate Bot <renovate@zarantonello.dev> Co-committed-by: Renovate Bot <renovate@zarantonello.dev>
…mmich-app#25984) * Fix image cancellation to be stream-scoped instead of widget-scoped * fix(OneFramePlaceholderImageStreamCompleter): make onLastListenerRemoved callback synchronous with removing the last listener * fix(OneFrameMultiImageStreamCompleter): remove unnecessary blank line in code * fix(OneFramePlaceholderImageStreamCompleter): cancel pending requests when only cache listener remains * fix(OneFrameMultiImageStreamCompleter): ensure onLastListenerRemoved callback is invoked only once
##### [\`v2.5.6\`](https://github.com/immich-app/immich/releases/tag/v2.5.6) ##### v2.5.6 This patch release addresses the following issues - Fixed an issue where thumbnail generation runs every night when `full-size image generation` option is enabled. - Fixed an issue where iOS is slow to start in some cases. - Fixed an issue where Android device cannot delete asset using Free Up Space feature if it has more than a few thousand assets <!-- Release notes generated using configuration in .github/release.yml at v2.5.6 --> ##### 🐛 Bug fixes - fix: enhance album sorting functionality with order handling by [@LeLunZ](https://github.com/LeLunZ) in [#24816](immich-app/immich#24816) - fix: add missing translations for image editor by [@michelheusschen](https://github.com/michelheusschen) in [#25957](immich-app/immich#25957) - fix: image and video download complete notification shows "file\_name" by [@romoisverycool](https://github.com/romoisverycool) in [#25975](immich-app/immich#25975) - fix: user profile refetched each time on opening app dialog by [@shenlong-tanwen](https://github.com/shenlong-tanwen) in [#25992](immich-app/immich#25992) - fix: improve albums page load time on firefox by [@michelheusschen](https://github.com/michelheusschen) in [#26025](immich-app/immich#26025) - fix: reduce queue graph jitter and include paused count by [@michelheusschen](https://github.com/michelheusschen) in [#26023](immich-app/immich#26023) - fix(web): toast fixed location by [@YarosMallorca](https://github.com/YarosMallorca) in [#25966](immich-app/immich#25966) - fix: scroll jump when opening show & hide people by [@michelheusschen](https://github.com/michelheusschen) in [#25932](immich-app/immich#25932) - fix(web): display storage unit next to value instead of absolute positioning in admin user page by [@K0lin](https://github.com/K0lin) in [#25985](immich-app/immich#25985) - fix: iOS slow start by [@alextran1502](https://github.com/alextran1502) in [#26043](immich-app/immich#26043) - fix: profile dialog auto dismiss after opening on iPad by [@alextran1502](https://github.com/alextran1502) in [#26046](immich-app/immich#26046) - fix(web): prevent context menu from overflowing viewport by [@ttpss930141011](https://github.com/ttpss930141011) in [#26041](immich-app/immich#26041) - fix: slideshow setting dropdown overflow by [@michelheusschen](https://github.com/michelheusschen) in [#26066](immich-app/immich#26066) - fix: free up space using small batch size to reliably work on Android by [@alextran1502](https://github.com/alextran1502) in [#26047](immich-app/immich#26047) - fix(web): removing a person in an asset, doesn't remove the asset in … by [@dolfje](https://github.com/dolfje) in [#26068](immich-app/immich#26068) - fix(mobile): handle image stream completion when no image is emitted by [@LeLunZ](https://github.com/LeLunZ) in [#25984](immich-app/immich#25984) - fix: evict image from cache on error during image loading by [@LeLunZ](https://github.com/LeLunZ) in [#26078](immich-app/immich#26078) - fix(server): thumbnail queueing by [@mertalev](https://github.com/mertalev) in [#26077](immich-app/immich#26077) - fix: create face exif orientation handling by [@bwees](https://github.com/bwees) in [#26108](immich-app/immich#26108) - fix(web): refresh text by [@jrasm91](https://github.com/jrasm91) in [#26071](immich-app/immich#26071) - fix: correctly cancel select all assets by [@michelheusschen](https://github.com/michelheusschen) in [#26067](immich-app/immich#26067) - fix: person thumbnail generation on edited assets by [@bwees](https://github.com/bwees) in [#26112](immich-app/immich#26112) - fix: local date time group fall back by [@alextran1502](https://github.com/alextran1502) in [#26110](immich-app/immich#26110) ##### 📚 Documentation - feat(docs): version policy by [@mmomjian](https://github.com/mmomjian) in [#25979](immich-app/immich#25979) - feat(deployment): rootless compose file by [@mmomjian](https://github.com/mmomjian) in [#25931](immich-app/immich#25931) - docs: update ml-hardware-acceleration.md by [@cmrtdev](https://github.com/cmrtdev) in [#25755](immich-app/immich#25755) ##### 🌐 Translations - chore(web): update translations by [@weblate](https://github.com/weblate) in [#25947](immich-app/immich#25947) ##### New Contributors - [@ttpss930141011](https://github.com/ttpss930141011) made their first contribution in [#26041](immich-app/immich#26041) - [@dolfje](https://github.com/dolfje) made their first contribution in [#26068](immich-app/immich#26068) - [@cmrtdev](https://github.com/cmrtdev) made their first contribution in [#25755](immich-app/immich#25755) - [@nicosemp](https://github.com/nicosemp) made their first contribution in [#25599](immich-app/immich#25599) **Full Changelog**: <immich-app/immich@v2.5.5...v2.5.6> --- ##### [\`v2.5.5\`](https://github.com/immich-app/immich/releases/tag/v2.5.5) ##### v2.5.5 *`v2.5.4` was in the way of getting out, and we got another annoyance bug fixed, so we rolled it into `v2.5.5`* Happy Friday! This release addresses more bugs from the `v2.5.0` release. Enjoy! - Fixed an issue where changing the timezone on the web changes the time instead of the timezone - Fixed an issue where background task on iOS don't get triggered as often - Fixes some issues regarding the usage of self-signed certificate and mLTS on the mobile app ##### 🐛 Bug fixes - fix(mobile): cancel share download when dialog is dismissed by [@cmdPromptCritical](https://github.com/cmdPromptCritical) in [#25466](immich-app/immich#25466) - fix: album dto docs by [@jrasm91](https://github.com/jrasm91) in [#25873](immich-app/immich#25873) - fix: null validation by [@jrasm91](https://github.com/jrasm91) in [#25891](immich-app/immich#25891) - fix(server): deleting stacked assets by [@jrasm91](https://github.com/jrasm91) in [#25874](immich-app/immich#25874) - fix: close tag modal after tagging assets by [@michelheusschen](https://github.com/michelheusschen) in [#25884](immich-app/immich#25884) - fix: correctly sync shared link download with metadata toggle by [@michelheusschen](https://github.com/michelheusschen) in [#25885](immich-app/immich#25885) - fix: date time picker text color in dark mode by [@alextran1502](https://github.com/alextran1502) in [#25883](immich-app/immich#25883) - fix: allow null tagIds in search dto by [@michelheusschen](https://github.com/michelheusschen) in [#25920](immich-app/immich#25920) - fix: improve asset editor exit handling by [@michelheusschen](https://github.com/michelheusschen) in [#25917](immich-app/immich#25917) - fix: make switch labels properly clickable by [@michelheusschen](https://github.com/michelheusschen) in [#25898](immich-app/immich#25898) - fix: ensure theme stays in sync with [@immich/ui](https://github.com/immich/ui) by [@michelheusschen](https://github.com/michelheusschen) in [#25922](immich-app/immich#25922) - fix: preserve hidden people state across pagination by [@michelheusschen](https://github.com/michelheusschen) in [#25886](immich-app/immich#25886) - fix: file name search label by [@alextran1502](https://github.com/alextran1502) in [#25916](immich-app/immich#25916) - fix(mobile): mtls on native clients by [@mertalev](https://github.com/mertalev) in [#25802](immich-app/immich#25802) - fix: time zone upserts by [@danieldietzler](https://github.com/danieldietzler) in [#25889](immich-app/immich#25889) - fix(web): Ensure profile picture is cropped to 1:1 ratio by [@aditya-ai-architect](https://github.com/aditya-ai-architect) in [#25892](immich-app/immich#25892) - fix(mobile): reset asset index on timeline refresh by [@uhthomas](https://github.com/uhthomas) in [#25729](immich-app/immich#25729) - fix: timezone in timeline bucketing by [@shenlong-tanwen](https://github.com/shenlong-tanwen) in [#25894](immich-app/immich#25894) - fix(mobile): Update preview and PageController position when the asset count decreases while the last item is selected by [@PeterOmbodi](https://github.com/PeterOmbodi) in [#25563](immich-app/immich#25563) - fix(server): use provided database username for restore & ensure name is not mangled by [@insertish](https://github.com/insertish) in [#25679](immich-app/immich#25679) - fix: image download complete notification shows an extra {file\_name} template tag by [@romoisverycool](https://github.com/romoisverycool) in [#25936](immich-app/immich#25936) - fix: face and edit handling by [@bwees](https://github.com/bwees) in [#25738](immich-app/immich#25738) - fix: queue assets missing fullsize files for thumbnail regeneration by [@midzelis](https://github.com/midzelis) in [#25794](immich-app/immich#25794) - fix: dedupe version announcement modal by [@jrasm91](https://github.com/jrasm91) in [#25946](immich-app/immich#25946) - fix(cli): suppress startup messages for immich-admin by [@VahantSharma](https://github.com/VahantSharma) in [#25928](immich-app/immich#25928) ##### 📚 Documentation - docs: update manual backup/restore to match the automatic process by [@insertish](https://github.com/insertish) in [#25924](immich-app/immich#25924) - fix(docs): add missing --json-output arg to CLI example by [@Xiol](https://github.com/Xiol) in [#25870](immich-app/immich#25870) - docs: remove writeTimeout on traefik example by [@kaysond](https://github.com/kaysond) in [#25837](immich-app/immich#25837) ##### 🌐 Translations - chore(web): update translations by [@weblate](https://github.com/weblate) in [#25585](immich-app/immich#25585) ##### New Contributors - [@aditya-ai-architect](https://github.com/aditya-ai-architect) made their first contribution in [#25892](immich-app/immich#25892) - [@VahantSharma](https://github.com/VahantSharma) made their first contribution in [#25927](immich-app/immich#25927) - [@Xiol](https://github.com/Xiol) made their first contribution in [#25870](immich-app/immich#25870) - [@cmdPromptCritical](https://github.com/cmdPromptCritical) made their first contribution in [#25466](immich-app/immich#25466) - [@romoisverycool](https://github.com/romoisverycool) made their first contribution in [#25936](immich-app/immich#25936) - [@didekoning](https://github.com/didekoning) made their first contribution in [#25937](immich-app/immich#25937) **Full Changelog**: <immich-app/immich@v2.5.3...v2.5.5> --- ##### [\`v2.5.3\`](https://github.com/immich-app/immich/releases/tag/v2.5.3) ##### What's Changed ##### 🐛 Bug fixes - chore: remove random code snippet by [@jrasm91](https://github.com/jrasm91) in [#25677](immich-app/immich#25677) - fix: reset and unsaved change states in editor by [@bwees](https://github.com/bwees) in [#25588](immich-app/immich#25588) - fix: no notification if release check is disabled by [@jrasm91](https://github.com/jrasm91) in [#25688](immich-app/immich#25688) - fix(mobile): hide latest version if disabled by [@uhthomas](https://github.com/uhthomas) in [#25691](immich-app/immich#25691) - fix(web): enable asset viewer navigation across memory boundaries by [@midzelis](https://github.com/midzelis) in [#25741](immich-app/immich#25741) - fix: upload progress bar flickering by [@alextran1502](https://github.com/alextran1502) in [#25829](immich-app/immich#25829) - fix: prevent stale values in edit user form after save by [@michelheusschen](https://github.com/michelheusschen) in [#25859](immich-app/immich#25859) - fix: prevent album page get rebuilt when resuming app by [@alextran1502](https://github.com/alextran1502) in [#25862](immich-app/immich#25862) - fix: prevent backspace from accidentally triggering delete modals by [@michelheusschen](https://github.com/michelheusschen) in [#25858](immich-app/immich#25858) - fix: metadata extraction race condition by [@danieldietzler](https://github.com/danieldietzler) in [#25866](immich-app/immich#25866) - fix: reset zoom when navigating between assets by [@michelheusschen](https://github.com/michelheusschen) in [#25863](immich-app/immich#25863) ##### 📚 Documentation - docs(openapi): Add descriptions to OpenAPI specification by [@timonrieger](https://github.com/timonrieger) in [#25185](immich-app/immich#25185) - fix(docs): clarify supported vector version by [@mmomjian](https://github.com/mmomjian) in [#25753](immich-app/immich#25753) **Full Changelog**: <immich-app/immich@v2.5.2...v2.5.3>
##### [\`v2.5.6\`](https://github.com/immich-app/immich/releases/tag/v2.5.6) ##### v2.5.6 This patch release addresses the following issues - Fixed an issue where thumbnail generation runs every night when `full-size image generation` option is enabled. - Fixed an issue where iOS is slow to start in some cases. - Fixed an issue where Android device cannot delete asset using Free Up Space feature if it has more than a few thousand assets <!-- Release notes generated using configuration in .github/release.yml at v2.5.6 --> ##### 🐛 Bug fixes - fix: enhance album sorting functionality with order handling by [@LeLunZ](https://github.com/LeLunZ) in [#24816](immich-app/immich#24816) - fix: add missing translations for image editor by [@michelheusschen](https://github.com/michelheusschen) in [#25957](immich-app/immich#25957) - fix: image and video download complete notification shows "file\_name" by [@romoisverycool](https://github.com/romoisverycool) in [#25975](immich-app/immich#25975) - fix: user profile refetched each time on opening app dialog by [@shenlong-tanwen](https://github.com/shenlong-tanwen) in [#25992](immich-app/immich#25992) - fix: improve albums page load time on firefox by [@michelheusschen](https://github.com/michelheusschen) in [#26025](immich-app/immich#26025) - fix: reduce queue graph jitter and include paused count by [@michelheusschen](https://github.com/michelheusschen) in [#26023](immich-app/immich#26023) - fix(web): toast fixed location by [@YarosMallorca](https://github.com/YarosMallorca) in [#25966](immich-app/immich#25966) - fix: scroll jump when opening show & hide people by [@michelheusschen](https://github.com/michelheusschen) in [#25932](immich-app/immich#25932) - fix(web): display storage unit next to value instead of absolute positioning in admin user page by [@K0lin](https://github.com/K0lin) in [#25985](immich-app/immich#25985) - fix: iOS slow start by [@alextran1502](https://github.com/alextran1502) in [#26043](immich-app/immich#26043) - fix: profile dialog auto dismiss after opening on iPad by [@alextran1502](https://github.com/alextran1502) in [#26046](immich-app/immich#26046) - fix(web): prevent context menu from overflowing viewport by [@ttpss930141011](https://github.com/ttpss930141011) in [#26041](immich-app/immich#26041) - fix: slideshow setting dropdown overflow by [@michelheusschen](https://github.com/michelheusschen) in [#26066](immich-app/immich#26066) - fix: free up space using small batch size to reliably work on Android by [@alextran1502](https://github.com/alextran1502) in [#26047](immich-app/immich#26047) - fix(web): removing a person in an asset, doesn't remove the asset in … by [@dolfje](https://github.com/dolfje) in [#26068](immich-app/immich#26068) - fix(mobile): handle image stream completion when no image is emitted by [@LeLunZ](https://github.com/LeLunZ) in [#25984](immich-app/immich#25984) - fix: evict image from cache on error during image loading by [@LeLunZ](https://github.com/LeLunZ) in [#26078](immich-app/immich#26078) - fix(server): thumbnail queueing by [@mertalev](https://github.com/mertalev) in [#26077](immich-app/immich#26077) - fix: create face exif orientation handling by [@bwees](https://github.com/bwees) in [#26108](immich-app/immich#26108) - fix(web): refresh text by [@jrasm91](https://github.com/jrasm91) in [#26071](immich-app/immich#26071) - fix: correctly cancel select all assets by [@michelheusschen](https://github.com/michelheusschen) in [#26067](immich-app/immich#26067) - fix: person thumbnail generation on edited assets by [@bwees](https://github.com/bwees) in [#26112](immich-app/immich#26112) - fix: local date time group fall back by [@alextran1502](https://github.com/alextran1502) in [#26110](immich-app/immich#26110) ##### 📚 Documentation - feat(docs): version policy by [@mmomjian](https://github.com/mmomjian) in [#25979](immich-app/immich#25979) - feat(deployment): rootless compose file by [@mmomjian](https://github.com/mmomjian) in [#25931](immich-app/immich#25931) - docs: update ml-hardware-acceleration.md by [@cmrtdev](https://github.com/cmrtdev) in [#25755](immich-app/immich#25755) ##### 🌐 Translations - chore(web): update translations by [@weblate](https://github.com/weblate) in [#25947](immich-app/immich#25947) ##### New Contributors - [@ttpss930141011](https://github.com/ttpss930141011) made their first contribution in [#26041](immich-app/immich#26041) - [@dolfje](https://github.com/dolfje) made their first contribution in [#26068](immich-app/immich#26068) - [@cmrtdev](https://github.com/cmrtdev) made their first contribution in [#25755](immich-app/immich#25755) - [@nicosemp](https://github.com/nicosemp) made their first contribution in [#25599](immich-app/immich#25599) **Full Changelog**: <immich-app/immich@v2.5.5...v2.5.6> --- ##### [\`v2.5.5\`](https://github.com/immich-app/immich/releases/tag/v2.5.5) ##### v2.5.5 *`v2.5.4` was in the way of getting out, and we got another annoyance bug fixed, so we rolled it into `v2.5.5`* Happy Friday! This release addresses more bugs from the `v2.5.0` release. Enjoy! - Fixed an issue where changing the timezone on the web changes the time instead of the timezone - Fixed an issue where background task on iOS don't get triggered as often - Fixes some issues regarding the usage of self-signed certificate and mLTS on the mobile app ##### 🐛 Bug fixes - fix(mobile): cancel share download when dialog is dismissed by [@cmdPromptCritical](https://github.com/cmdPromptCritical) in [#25466](immich-app/immich#25466) - fix: album dto docs by [@jrasm91](https://github.com/jrasm91) in [#25873](immich-app/immich#25873) - fix: null validation by [@jrasm91](https://github.com/jrasm91) in [#25891](immich-app/immich#25891) - fix(server): deleting stacked assets by [@jrasm91](https://github.com/jrasm91) in [#25874](immich-app/immich#25874) - fix: close tag modal after tagging assets by [@michelheusschen](https://github.com/michelheusschen) in [#25884](immich-app/immich#25884) - fix: correctly sync shared link download with metadata toggle by [@michelheusschen](https://github.com/michelheusschen) in [#25885](immich-app/immich#25885) - fix: date time picker text color in dark mode by [@alextran1502](https://github.com/alextran1502) in [#25883](immich-app/immich#25883) - fix: allow null tagIds in search dto by [@michelheusschen](https://github.com/michelheusschen) in [#25920](immich-app/immich#25920) - fix: improve asset editor exit handling by [@michelheusschen](https://github.com/michelheusschen) in [#25917](immich-app/immich#25917) - fix: make switch labels properly clickable by [@michelheusschen](https://github.com/michelheusschen) in [#25898](immich-app/immich#25898) - fix: ensure theme stays in sync with [@immich/ui](https://github.com/immich/ui) by [@michelheusschen](https://github.com/michelheusschen) in [#25922](immich-app/immich#25922) - fix: preserve hidden people state across pagination by [@michelheusschen](https://github.com/michelheusschen) in [#25886](immich-app/immich#25886) - fix: file name search label by [@alextran1502](https://github.com/alextran1502) in [#25916](immich-app/immich#25916) - fix(mobile): mtls on native clients by [@mertalev](https://github.com/mertalev) in [#25802](immich-app/immich#25802) - fix: time zone upserts by [@danieldietzler](https://github.com/danieldietzler) in [#25889](immich-app/immich#25889) - fix(web): Ensure profile picture is cropped to 1:1 ratio by [@aditya-ai-architect](https://github.com/aditya-ai-architect) in [#25892](immich-app/immich#25892) - fix(mobile): reset asset index on timeline refresh by [@uhthomas](https://github.com/uhthomas) in [#25729](immich-app/immich#25729) - fix: timezone in timeline bucketing by [@shenlong-tanwen](https://github.com/shenlong-tanwen) in [#25894](immich-app/immich#25894) - fix(mobile): Update preview and PageController position when the asset count decreases while the last item is selected by [@PeterOmbodi](https://github.com/PeterOmbodi) in [#25563](immich-app/immich#25563) - fix(server): use provided database username for restore & ensure name is not mangled by [@insertish](https://github.com/insertish) in [#25679](immich-app/immich#25679) - fix: image download complete notification shows an extra {file\_name} template tag by [@romoisverycool](https://github.com/romoisverycool) in [#25936](immich-app/immich#25936) - fix: face and edit handling by [@bwees](https://github.com/bwees) in [#25738](immich-app/immich#25738) - fix: queue assets missing fullsize files for thumbnail regeneration by [@midzelis](https://github.com/midzelis) in [#25794](immich-app/immich#25794) - fix: dedupe version announcement modal by [@jrasm91](https://github.com/jrasm91) in [#25946](immich-app/immich#25946) - fix(cli): suppress startup messages for immich-admin by [@VahantSharma](https://github.com/VahantSharma) in [#25928](immich-app/immich#25928) ##### 📚 Documentation - docs: update manual backup/restore to match the automatic process by [@insertish](https://github.com/insertish) in [#25924](immich-app/immich#25924) - fix(docs): add missing --json-output arg to CLI example by [@Xiol](https://github.com/Xiol) in [#25870](immich-app/immich#25870) - docs: remove writeTimeout on traefik example by [@kaysond](https://github.com/kaysond) in [#25837](immich-app/immich#25837) ##### 🌐 Translations - chore(web): update translations by [@weblate](https://github.com/weblate) in [#25585](immich-app/immich#25585) ##### New Contributors - [@aditya-ai-architect](https://github.com/aditya-ai-architect) made their first contribution in [#25892](immich-app/immich#25892) - [@VahantSharma](https://github.com/VahantSharma) made their first contribution in [#25927](immich-app/immich#25927) - [@Xiol](https://github.com/Xiol) made their first contribution in [#25870](immich-app/immich#25870) - [@cmdPromptCritical](https://github.com/cmdPromptCritical) made their first contribution in [#25466](immich-app/immich#25466) - [@romoisverycool](https://github.com/romoisverycool) made their first contribution in [#25936](immich-app/immich#25936) - [@didekoning](https://github.com/didekoning) made their first contribution in [#25937](immich-app/immich#25937) **Full Changelog**: <immich-app/immich@v2.5.3...v2.5.5> --- ##### [\`v2.5.3\`](https://github.com/immich-app/immich/releases/tag/v2.5.3) ##### What's Changed ##### 🐛 Bug fixes - chore: remove random code snippet by [@jrasm91](https://github.com/jrasm91) in [#25677](immich-app/immich#25677) - fix: reset and unsaved change states in editor by [@bwees](https://github.com/bwees) in [#25588](immich-app/immich#25588) - fix: no notification if release check is disabled by [@jrasm91](https://github.com/jrasm91) in [#25688](immich-app/immich#25688) - fix(mobile): hide latest version if disabled by [@uhthomas](https://github.com/uhthomas) in [#25691](immich-app/immich#25691) - fix(web): enable asset viewer navigation across memory boundaries by [@midzelis](https://github.com/midzelis) in [#25741](immich-app/immich#25741) - fix: upload progress bar flickering by [@alextran1502](https://github.com/alextran1502) in [#25829](immich-app/immich#25829) - fix: prevent stale values in edit user form after save by [@michelheusschen](https://github.com/michelheusschen) in [#25859](immich-app/immich#25859) - fix: prevent album page get rebuilt when resuming app by [@alextran1502](https://github.com/alextran1502) in [#25862](immich-app/immich#25862) - fix: prevent backspace from accidentally triggering delete modals by [@michelheusschen](https://github.com/michelheusschen) in [#25858](immich-app/immich#25858) - fix: metadata extraction race condition by [@danieldietzler](https://github.com/danieldietzler) in [#25866](immich-app/immich#25866) - fix: reset zoom when navigating between assets by [@michelheusschen](https://github.com/michelheusschen) in [#25863](immich-app/immich#25863) ##### 📚 Documentation - docs(openapi): Add descriptions to OpenAPI specification by [@timonrieger](https://github.com/timonrieger) in [#25185](immich-app/immich#25185) - fix(docs): clarify supported vector version by [@mmomjian](https://github.com/mmomjian) in [#25753](immich-app/immich#25753) **Full Changelog**: <immich-app/immich@v2.5.2...v2.5.3> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Description
Issue:
Currently if you press on a loading Thumbnail (image not present), the new route (or how its called in flutter) gets created where the
RemoteFullImageProviderwill try to wait on theinitialImageStreamof the same Thumbnail (where the request is loading and is still the cache).The problem: the Thumbnail widget calls
.cancelon the Thumbnail provider after theRemoteFullImageProvideralready loaded the providerRemoteThumbProvider(assetId: key.assetId, thumbhash: key.thumbhash).So now the
RemoteThumbProviderwaits on the initialImage, while the Thumbnail widget canceled the request. So the provider never emits an image, and theRemoteFullImageProviderwill wait forever.So short: race condition because one calls cancel, while the other one waits on the request
In the current immich application there are 2 ways the image request can get cancelled:
provider.cancel()(currently only the Thumbnail widget does that)OneFramePlaceholderImageStreamCompleterif its disposed and invokes the callbackThat makes it problematical, as no Widget actually owns an image/imagestream or whatever. So it actually shouldn't be able to forcefully cancel an image request.
It can be that the "same" stream is used by multiple widgets
The fix:
Instead of letting widgets call
cancelor waiting till theOneFramePlaceholderImageStreamCompleteris disposed (whenever flutter engine decides to), I think we should just cancel the image if no more listener is subscribed to the ImageStream.So I think I implemented the quickest fix with the
addOnLastListenerRemovedCallbackin the ImageStreamCompleter.No need to call
.cancelanymore from the widgets, its just important that you always unsubscribe the stream if you don't need it anymore (same as before).Fixes #25723
How Has This Been Tested?
Checklist:
src/services/uses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/)Please describe to which degree, if any, an LLM was used in creating this pull request.
Getting a quick overview of the code, and some insights on where to investigate.