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

App crashes when clicking messages under specific conditions #13830

Open
3 tasks done
JunWookKim opened this issue Dec 10, 2024 · 0 comments
Open
3 tasks done

App crashes when clicking messages under specific conditions #13830

JunWookKim opened this issue Dec 10, 2024 · 0 comments

Comments

@JunWookKim
Copy link

Guidelines

  • I have searched searched open and closed issues for duplicates
  • I am submitting a bug report for existing functionality that does not work as intended
  • This isn't a feature request or a discussion topic

Bug description

When sending a sticker in Signal, only the sticker is transmitted by default without any text. However, using a hook script to append text after sending a sticker results in the following behavior:

  1. The receiver only sees the text message without the sticker.
    1

  2. Clicking on this text causes the app to crash on the receiver's side.
    2

Crash Analysis

The crash occurs in the following file: ConversationItem.java

@Override
public @NonNull MultiselectPart getMultiselectPartForLatestTouch() {
  MultiselectCollection parts = conversationMessage.getMultiselectCollection();

  if (parts.isSingle()) {
    return parts.asSingle().getSinglePart();
  }

  MultiselectPart top    = parts.asDouble().getTopPart();
  MultiselectPart bottom = parts.asDouble().getBottomPart();

  if (hasThumbnail(messageRecord)) {
    return isTouchBelowBoundary(mediaThumbnailStub.require()) ? bottom : top;
  } else if (hasDocument(messageRecord)) {
    return isTouchBelowBoundary(documentViewStub.get()) ? bottom : top;
  } else if (hasAudio(messageRecord)) {
    return isTouchBelowBoundary(audioViewStub.get()) ? bottom : top;
  } {
    throw new IllegalStateException("Found a situation where we have something other than a thumbnail or a document.");
  }
}

Cause

The IllegalStateException is triggered in the final else block when none of the conditions are satisfied. This happens because the malformed message, created by appending text to a sticker, results in an incomplete MultiselectCollection.

This report is prepared in collaboration with @dawitngoliath, @dg2vy, @Pongchi, @moooooji and @qw3rtyou

Screenshots

No response

Device

Samsung SM-N976N

Android version

14

Signal version

7.26.1

Link to debug log

https://debuglogs.org/android/7.26.1/fb32ed6c1c5b0671688cf2b2785a543942854f16edac0e0cac18b73072ce890c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant