Skip to content
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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Dec 3, 2024

This PR was automatically cherry-picked based on the following PR:

Original PR description:


BugWPB-14433 [Android] Crash after longtapping on a conversation and putting phone to sleep


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

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)

  • I have added automated test to this contribution

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)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@github-actions github-actions bot added cherry-pick PR is cherry-picking changes from another banch echoes: unplanned Any work item that isn’t part of the product or technical roadmap. size/XL labels Dec 3, 2024
Copy link

Ups 🫰🟨

This PR is too big. Please try to break it up into smaller PRs.

Comment on lines -77 to -82
// 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)
Copy link
Contributor

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 🙇

Copy link

sonarcloud bot commented Dec 4, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick PR is cherry-picking changes from another banch echoes: unplanned Any work item that isn’t part of the product or technical roadmap. size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants