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 race condition while loading messages #47

Merged
merged 1 commit into from
Feb 17, 2019
Merged

Fix race condition while loading messages #47

merged 1 commit into from
Feb 17, 2019

Conversation

jmattheis
Copy link
Member

Images didn't load correctly when the following scenario occurred:

  • ApplicationHolder#request
  • MessagesActivity.SelectApplicationAndUpdateMessages#execute
  • MessagesActivity.SelectApplicationAndUpdateMessages#doInBackground
    • method returns List<MessageWithImage>, but images are "null" because
      apps aren't loaded yet.
  • MessagesActivity#onUpdateApps
    • Now apps were loaded and cached.
  • MessagesActivity.SelectApplicationAndUpdateMessages#onPostExecute
    • receives List<MessageWithImage> from #doInBackgroud with "null" images

-> Messages with "null" images are rendered in the ListView

@eternal-flame-AD you can review this if you like otherwise I'd just merge it.

Images didn't load correctly when the following scenario occurred:
* ApplicationHolder#request
* MessagesActivity.SelectApplicationAndUpdateMessages#execute
* MessagesActivity.SelectApplicationAndUpdateMessages#doInBackground
  - method returns List<MessageWithImage>, but images are "null" because
    apps aren't loaded yet.
* MessagesActivity#onUpdateApps
  - Now apps were loaded and cached.
* MessagesActivity.SelectApplicationAndUpdateMessages#onPostExecute
  - receives List<MessageWithImage> from #doInBackgroud with "null" images
-> Messages with "null" images are rendered in the ListView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants