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

java.lang.IndexOutOfBoundsException #1334

Open
iamarjun opened this issue Dec 30, 2024 · 3 comments
Open

java.lang.IndexOutOfBoundsException #1334

iamarjun opened this issue Dec 30, 2024 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@iamarjun
Copy link

✍️ Describe the bug

Chucker crashes with java.lang.IndexOutOfBoundsException when we try to search for something in the response tab.

💣 Steps to reproduce

  1. Go to the Response tab in chucker
  2. Click on the search button and start searching for anything in the response
  3. Chucker crashes with java.lang.IndexOutOfBoundsException
Process: com.cheq.retail.uat, PID: 6919
                                                                                                    java.lang.IndexOutOfBoundsException: setSpan (26 ... 33) ends beyond length 26
                                                                                                    	at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1326)
                                                                                                    	at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:685)
                                                                                                    	at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:677)
                                                                                                    	at com.chuckerteam.chucker.internal.support.SearchHighlightUtilKt.applyColoredSpannableSubstring(SearchHighlightUtil.kt:47)
                                                                                                    	at com.chuckerteam.chucker.internal.support.SearchHighlightUtilKt.highlightWithDefinedColorsSubstring(SearchHighlightUtil.kt:36)
                                                                                                    	at com.chuckerteam.chucker.internal.ui.transaction.TransactionBodyAdapter.highlightItemWithColorOnPosition$com_github_ChuckerTeam_Chucker_library(TransactionPayloadAdapter.kt:139)
                                                                                                    	at com.chuckerteam.chucker.internal.ui.transaction.TransactionPayloadFragment.scrollToSearchedItemPosition(TransactionPayloadFragment.kt:378)
                                                                                                    	at com.chuckerteam.chucker.internal.ui.transaction.TransactionPayloadFragment.access$scrollToSearchedItemPosition(TransactionPayloadFragment.kt:47)
                                                                                                    	at com.chuckerteam.chucker.internal.ui.transaction.TransactionPayloadFragment$onQueryTextChange$1.invokeSuspend(TransactionPayloadFragment.kt:338)
                                                                                                    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                    	at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:221)
                                                                                                    	at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:154)
                                                                                                    	at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:470)
                                                                                                    	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$kotlinx_coroutines_core(CancellableContinuationImpl.kt:504)
                                                                                                    	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$kotlinx_coroutines_core$default(CancellableContinuationImpl.kt:493)
                                                                                                    	at kotlinx.coroutines.CancellableContinuationImpl.resumeUndispatched(CancellableContinuationImpl.kt:596)
                                                                                                    	at kotlinx.coroutines.android.HandlerContext$scheduleResumeAfterDelay$$inlined$Runnable$1.run(Runnable.kt:14)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:959)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:100)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:232)
                                                                                                    	at android.os.Looper.loop(Looper.java:317)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8705)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
                                                                                                    	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@d6d5fd5, Dispatchers.Main.immediate]

🔧 Expected behavior

Chucker shouldn't crash and auto scrolls to the desired result

📱 Tech info

  • Device: Pixel 7a
  • OS: 15
  • Chucker version: 4.1.0
@cortinico
Copy link
Member

  1. Go to the Response tab in chucker

Does this reproduce on the Chucker sample app?

@iamarjun
Copy link
Author

iamarjun commented Jan 2, 2025

  1. Go to the Response tab in chucker

Does this reproduce on the Chucker sample app?

output.mp4

yes it does, PFA the video

@cortinico cortinico added the help wanted Extra attention is needed label Jan 2, 2025
@cortinico
Copy link
Member

yes it does, PFA the video

Great thank you very much 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants