Repository navigation
Stop the phone crashing on a reply line that starts with a mousse:// link - #54
Merged
Merged
Conversation
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.
On Android, a thread crashes the app when a paragraph or list item in a reply starts with a
mousse://link. The demo's links thread (t-links) crashes on main as soon as it opens.Cause
InlineTextbuilds the text with chips from pieces of the reply. When a link starts the paragraph, the piece before it is empty.AnnotatedString.subSequence(0, 0)still carries the link it touches, as a link of no length. Compose'sTextLinkScopethen asks for the box at offset -1 and throws:Fix
withChips(MessageLinks.kt), which never appends an empty piece.Verification
MessageLinksTestcovers a link at the start, at the end, and two side by side, each with and without chips. No piece may carry a link of no length, and the text must stay the same.18 tests completed, 2 failed). With the fix, all pass.scripts\android.ps1 testandbuild debugpass.studio/thread/t-links. With this fix it opens with every chip, and the crash log stays empty.No issue