Repository navigation
fix(invite): resolve invite channels off the main thread - #1594
Merged
Merged
Conversation
InternalInviteController called resolveChannels() in its constructor, and Hilt builds it on the main thread when MainActivity is injected. Loading the SMS and WhatsApp labels and icons reads those apps' APKs, which ANR'd on 2026.9.1 (three Bugsnag events on OPPO and Xiaomi devices, all stuck in ResolveInfo.loadLabel / getApplicationLabel under resolveChannels). Channels now start empty and resolve on the IO dispatcher. refresh() uses the same path.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
InternalInviteControllerresolved its invite channels in the constructor. Hilt builds it on the main thread whenMainActivityis injected, and loading the SMS and WhatsApp labels and icons reads those apps' APKs. On 2026.9.1 that produced three Bugsnag ANRs on OPPO and Xiaomi devices, each with the main thread inResolveInfo.loadLabel/getApplicationLabelunderresolveChannels.channelsnow starts empty and fills in from the IO dispatcher.refresh()takes the same path. The invite sheet already collectschannelsas state, so a sheet opened in the first moments after launch shows the options once they resolve.InternalInviteControllerTestcovers both halves: construction doesn't touchPackageManager, and the channels (SMS, More) arrive once the dispatcher runs. Makingrefresh()synchronous again fails the first test.