Automattic / simplenote-android

Simplenote for Android
https://simplenote.com
GNU General Public License v2.0
1.77k stars 299 forks source link

Crash when note reached certain character limit and contained whitespace character toward the end of the note #1537

Open erricgunawan opened 2 years ago

erricgunawan commented 2 years ago

From 4699943-zen:

When a note is above a certain character limit (42,686 characters in my case), the Android client crashes when you tap on the note in the notes list and try to edit the note. When you start editing a note below the character limit, and surpass the character limit while editing, the Android client does not crash. See if you can reproduce and fix the problem. I'm using v2.23, installed from the Google Play Store.

I deleted and retyped some whitespace characters towards the end of the note and the crash no longer occurs. The problematic whitespace characters originally came from a web page copy-and-paste. So the crash condition is note length, as stated, plus some unusual whitespace characters. Note length alone does not trigger a crash.

I added a little more text to the same note and the crashes started happening again. Deleting and retyping the whitespace in the most recently added text did not fix the issue. Opening the note and then tapping on or beyond the last line of the note causes a crash. The crashes are associated with note length, somewhere in the high 42Ks. For reference, I only type or paste UTF-8 characters, almost all ASCII, with a handful of non-ASCII but UTF-8 characters here and there.

Expected

App is not crashing. Or understand if there's a character limit for a note.

Observed

App is crashing as described above.

Reproduced

Unable to reproduce it.

Device Info

Waiting for some confirmation.

Device Make: - Device Model: - Android Version: - Simplenote Version: 2.23