QuantumBadger / QuantumBadger/RedReader

Crashes on r/nonpoliticaltwitter for too many flairs?

Open
#1,351 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
2.7k
Forks
527
Avg merge
20d 10h
Merged PRs (30d)
3

Description

When opening a r/nonpoliticaltwitter thread the app crashes.
Sometimes the flairs load and it works.
But doesn't on this one.
https://reddit.com/comments/1syjba0
I think it is the amount of flairs or just one specific flair.

Manufacturer: samsung
Android release: 16
Android SDK: 36

Debugging context: --- Begin stack trace ---
java.lang.IndexOutOfBoundsException: setSpan (45 ... 43) has end before start
at android.text.SpannableStringInternal.checkRange(spannablestringinternal.java:486)
at android.text.SpannableStringInternal.setSpan(spannablestringinternal.java:200)
at android.text.SpannableStringInternal.copySpansFromSpanned(spannablestringinternal.java:88)
at android.text.SpannableStringInternal. (spannablestringinternal.java:49)
at android.text.SpannedString. (spannedstring.java:36)
at android.text.SpannedString. (spannedstring.java:45)
at android.text.TextUtils.stringOrSpannedString(textutils.java:585)
at android.widget.TextView.setText(textview.java:7813)
at android.widget.TextView.setText(textview.java:7719)
at android.widget.TextView.setText(textview.java:7657)
at org.quantumbadger.redreader.views.RedditCommentView$$ExternalSyntheticLambda4.run(r8-map-id-2b85eeb7727e63a58a3fd94011ab026f48728d00862f441ac17975def196220b:28)
at android.os.Handler.handleCallback(handler.java:995)
at android.os.Handler.dispatchMessage(handler.java:103)
at android.os.Looper.loopOnce(looper.java:273)
at android.os.Looper.loop(looper.java:363)
at android.app.ActivityThread.main(activitythread.java:10060)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(runtimeinit.java:632)
at com.android.internal.os.ZygoteInit.main(zygoteinit.java:975)
--- End stack trace ---

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the crash with the linked r/nonpoliticaltwitter thread, then inspect the RedditCommentView path leading to TextView.setText in the stack trace. Compare threads where flairs load successfully with this thread and identify the span-range failure. Done means opening the linked thread no longer crashes, including when its flairs are present.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.