Skip to content

Search in response/request crashes #1350

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

Closed
barnhill opened this issue Mar 27, 2025 · 5 comments
Closed

Search in response/request crashes #1350

barnhill opened this issue Mar 27, 2025 · 5 comments

Comments

@barnhill
Copy link

barnhill commented Mar 27, 2025

✍️ Describe the bug

When viewing a request or response and using the search box any input will end with this stack trace and crash:

java.lang.IndexOutOfBoundsException: setSpan (41 ... 44) ends beyond length 1
  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)

💣 Steps to reproduce

  1. Go to a request/response in the chucker interface
  2. Click on the search box
  3. Enter some text to search that should be present in the response/request
  4. See error

🔧 Expected behavior

I expected the search to find the text in the request or response and highlight it.

📷 Screenshots

Stacktrace added above

📱 Tech info

  • Device: Pixel 8 Pro
  • OS: 15
  • Chucker version: 4.1.0

📄 Additional context

@cortinico
Copy link
Member

Does this happen also on the Chucker sample app?

@barnhill
Copy link
Author

No I tested that there. So maybe it's fixed?

@cortinico
Copy link
Member

Please test there and report back what's the outcome 🙏

@barnhill
Copy link
Author

I did and it seems fixed there.

@cortinico
Copy link
Member

Then there might be something going on specific to your request. If you manage to create a reproducer agains the sample app so that the library crashes in the same way, I could look into ti

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

No branches or pull requests

2 participants