Skip to content

fix: remove unused image cache manager override - #2354

Merged
TheNoumanDev merged 1 commit into
android_TV_implementationfrom
fix/remove-unused-image-cache-manager
Aug 27, 2026
Merged

fix: remove unused image cache manager override#2354
TheNoumanDev merged 1 commit into
android_TV_implementationfrom
fix/remove-unused-image-cache-manager

Conversation

@usmanvrtx

Copy link
Copy Markdown
Contributor

This PR removes the unused networkCacheManager override from the Image and Avatar controllers.

The override accepted only a runtime BaseCacheManager instance, which cannot be supplied through Ensemble YAML and has no in-repository caller. Image and Avatar continue to use Ensemble's internal cache manager, preserving redirect handling and configured cache behavior.

Related Issue

N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)

What Has Changed

  • Removed the unused networkCacheManager fields and setters from ImageController and AvatarController.
  • Kept EnsembleImageCacheManager.instanceFor(allowRedirect: ...) as the manager used by Image and Avatar network requests.
  • Renamed the framework Image helper parameter from networkCacheManager to cacheManager to clarify that it forwards the internally selected cache policy.
  • Preserved allowRedirect: false redirect blocking and App.imageCache configuration for both Image and Avatar.

How to Test

  1. Run the focused image widget tests:

    cd modules/ensemble
    flutter test test/widget/image_widget_test.dart
  2. Verify an Image and Avatar with a network source still load normally.

  3. Verify allowRedirect: false continues to reject redirected image requests.

  4. Verify configured App.imageCache settings still apply to network images.

Screenshots / Videos

N/A

Checklist

  • I have run flutter analyze and addressed any new warnings
  • I have run flutter test and all tests pass
  • I have tested my changes on the relevant platform(s)
  • I have updated documentation if needed
  • My changes do not introduce new warnings or errors

@usmanvrtx
usmanvrtx requested a review from TheNoumanDev August 27, 2026 09:19
@usmanvrtx usmanvrtx self-assigned this Aug 27, 2026
this.placeholderBuilder,
this.loadingWidget,
this.colorFilter,
this.networkCacheManager});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check main branch has this code, and in the main branch, the property name was networkCacheManager or cacheManager, and no flow is broken.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cacheManager name is internal use only and does not change any functionality or flow.

@TheNoumanDev TheNoumanDev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please verify the rest of your changes, any other stale changes please verify once again against each file, spend an hour on it, so that we dont have to come back again and fix things.

@usmanvrtx
usmanvrtx force-pushed the fix/remove-unused-image-cache-manager branch from f039ef4 to 596d524 Compare August 27, 2026 09:52
@usmanvrtx
usmanvrtx requested a review from TheNoumanDev August 27, 2026 11:42
@TheNoumanDev
TheNoumanDev merged commit ab4f8ac into android_TV_implementation Aug 27, 2026
6 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.

2 participants