Crash in RichTextViewModel.clearMatches()

#370 · open · 1 comments

View on GitHub ↗

Danil-Zosim

**Issue** The app is crashing during the search inside any response's body. It's constantly (each time) reproducing inside our customer app's debug panel, though it reproduced only 1-2 times in the Pulse Demo app. As a quick fix, would it be acceptable if I create PR with the safe range-checking before `addAttribute` call in `func clearMatches()`? **Steps to reproduce** 1. Open ConsoleView 2. Open any request which has json response body 3. Open request body 4. Search for any entry 5. Observe the crash in ~2 seconds. **Environment** - MacOS 26.5 (25F71) - Xcode Version 26.5 (17F42) - iPhone 17 - iOS 26.5 <img width="1668" height="858" alt="Image" src="https://github.com/user-attachments/assets/40ff417c-8844-4b00-8ac1-1e8aa0761a7e" />

Comments

aryanrai-aspora

I faced a similar crash in `RichTextViewModel.highlight()`, here's a screenshot: <img width="1067" height="116" alt="Image" src="https://github.com/user-attachments/assets/63cb12a5-fe15-4acd-89f3-cc88805d6833" /> --- Console Error: ``` *** Terminating app due to uncaught exception 'NSRangeException', reason: 'NSMutableRLEArray objectAtIndex:effectiveRange:: Out of bounds' *** First throw call stack: (0x18842e23c 0x184efd224 0x1855f0bc8 0x1855f1470 0x193d513d4 0x193ca8fe0 0x193d512d8 0x11a8cca48 0x11a8cc484 0x11a8cb800 0x11a8cb26c 0x11a8cc1f4 0x11a847eac 0x101ec4544 0x101eddccc 0x101eff748 0x101ed4204 0x101ed4144 0x1883bb030 0x188348604 0x18834754c 0x22dab3498 0x18e040244 0x18dfab158 0x191396570 0x1913930f4 0x191392c48 0x11495c3c8 0x11495c474 0x184f55c1c) terminating due to uncaught exception of type NSException textAndSelectAdditionalInputs+authorizationFlowResponse.json ```