fix(images): cancel orphaned thumbnail downloads#4695
Open
NotThatKindOfDrLiz wants to merge 4 commits into
Open
fix(images): cancel orphaned thumbnail downloads#4695NotThatKindOfDrLiz wants to merge 4 commits into
NotThatKindOfDrLiz wants to merge 4 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rabble
requested changes
May 24, 2026
Member
rabble
left a comment
There was a problem hiding this comment.
Found one issue that I think should be fixed before merge.
mobile/packages/media_cache/lib/src/media_cache_image_provider.dart:149:operator ==comparesauthHeadersby contents withmapEquals, buthashCodehashes theMapEntryobjects fromauthHeaders.entries.MapEntryequality/hash is identity-based, so two providers with equal header maps can compare equal while producing different hash codes. Since this class is anImageProviderkey, that violates the key contract used by Flutter'sImageCacheand can lead to duplicate/missed cache entries when callers pass equivalent header maps. Please hash headers by stable key/value pairs, for example sorted entries orObject.hashAllUnordered(entries.map((e) => Object.hash(e.key, e.value))), and add a regression test for equal providers with separate but equal header maps.
Verification I ran locally from mobile/:
flutter test packages/media_cache/test/src/media_cache_image_provider_test.dart test/widgets/vine_cached_image_test.dart
hm21
reviewed
May 25, 2026
hm21
approved these changes
May 25, 2026
Contributor
hm21
left a comment
There was a problem hiding this comment.
LGTM. I left only one minor nit comment but nothing blocking. I also tested it on android and it works perfectly fine for me.
b217da0 to
5a6bb6e
Compare
Mobile PR PreviewPreview refreshed for Last refresh:
|
Member
Author
|
Addressed the review feedback in commit 5a6bb6e. Changes in this update:
Local verification on this revision:
|
hm21
approved these changes
May 26, 2026
Member
Author
|
@rabble Can you please re-review and clear your requested changes? Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4692
Closes #4696
Summary
Verification
Notes