-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: revert of #3670 (WPB-14433) 🍒 #3702
Conversation
Ups 🫰🟨This PR is too big. Please try to break it up into smaller PRs. |
// limit the scope of the ViewModel to the current activity so that there's one image loader instance for the Activity | ||
viewModelStoreOwner = checkNotNull(LocalActivity.current as? AppCompatActivity ?: LocalViewModelStoreOwner.current) { | ||
"No ViewModelStoreOwner was provided via LocalViewModelStoreOwner" | ||
}, | ||
key = "remote_asset_image_loader" | ||
).imageLoader.paint(asset = this, fallbackData = fallbackData, withCrossfadeAnimation = withCrossfadeAnimation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure but now after understanding the issues with images I think that this could be the problem, so just removing passing viewmodelStoreOwner
and a key
should make it so that this view model and image loader is created per particular screen and not whole activity which means it's created again when account is switched 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yamilmedina I just checked that and images are loading fine for both logged in accounts from different federated environments after I removed just these two parameters viewModelStoreOwner
and key
, so it looks like this:
else -> hiltViewModel<RemoteAssetImageViewModel>().imageLoader
.paint(asset = this, fallbackData = fallbackData, withCrossfadeAnimation = withCrossfadeAnimation)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#3712
here's the alternative fix 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the fix
Quality Gate passedIssues Measures |
This PR was automatically cherry-picked based on the following PR:
Original PR description:
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
We introduced by caching the images, a problem visible as well by federation being enabled this week.
Causes (Optional)
Image loader is cached, and tries to use federation for assets.
Solutions
Revert the PR #3670 and pick the fixes needed only (#3689)
Testing
Test Coverage (Optional)
How to Test
Login with 2 accounts in different backends (staging and prod) and you should NOT have failed to load images.
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.