-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[image][Android] Fix You can't start or clear loads in RequestListener or Target callbacks
#21192
Merged
Conversation
This file contains 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
…er or Target callbacks`
lukmccall
commented
Feb 13, 2023
Comment on lines
+240
to
+248
// The "onResourceReady" function will be triggered when the new resource is available by the Glide. | ||
// According to the Glide documentation (https://bumptech.github.io/glide/doc/debugging.html#you-cant-start-or-clear-loads-in-requestlistener-or-target-callbacks), | ||
// it's not advisable to clear the Glide target within the stack frame. | ||
// To avoid this, a new runnable is posted to the front of the main queue, which can then clean or create targets. | ||
// This ensures that the "onResourceReady" frame of the Glide code will be discarded, and the internal state can be altered once again. | ||
// Normally, using "postAtFrontOfQueue" can lead to issues such as message queue starvation, ordering problems, and other unexpected consequences. | ||
// However, in this case, it is safe to use as long as nothing else is added to the queue. | ||
// The intention is simply to wait for the Glide code to finish before the content of the underlying views is changed during the same rendering tick. | ||
mainHandler.postAtFrontOfQueue { |
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.
Only this was changed. The rest is here because of the different formatting which has to be applied.
tsapeta
approved these changes
Feb 13, 2023
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
This was referenced Feb 15, 2023
This was referenced Feb 15, 2023
This was referenced Nov 30, 2023
This was referenced Dec 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bot: passed checks
ExpoBot has nothing to complain about
published
Changes from the PR have been published to npm
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.
Why
Fixes #21073.
How
Added a short delay between calling the
onResourceReady
and the modification of the underlying view content. More information in the code.Test Plan