mobile icon indicating copy to clipboard operation
mobile copied to clipboard

Android: App loses data if note contains a null character

Open mildmojo opened this issue 4 years ago • 3 comments

My Android phone's physical keyboard app has a quirk where, in some text areas, typing any alt character (numbers, punctuation) at the start of a new line inserts a null character (code 0x00) instead. These aren't rendered visually, and TBH before Standard Notes started discarding the contents of my notes, before I understood what was happening, I thought it was just a tolerable nuisance that I had to type alt characters twice to start a line. I figured it out when I tried Quill Notes, and it rendered null characters as question mark boxes.

Expected:

Standard Notes saves everything I enter into a note. (It would be okay if null characters were stripped out.)

Actual:

Standard Notes discards any text appearing after a null (0x00) character in the note body.

Steps to reproduce:

  1. Create a new note.
  2. Enter some text.
  3. Enter a null character (0x00), maybe with a connected USB or Bluetooth keyboard, or via the clipboard. It won't render anything; the cursor won't advance.
  4. Enter some more text.
  5. Tap the arrow at the top left to return to the notes list.
  6. Tap the new note to reopen it.
  7. Observe that all text after the null character was lost.

mildmojo avatar Oct 03 '21 05:10 mildmojo

I couldn't figure out what component powers the note editor, but maybe this issue is related to this 2-year-old React Native bug?

mildmojo avatar Oct 03 '21 05:10 mildmojo

Hi @mildmojo, thank you for reporting this issue to us. I'll forward it over to the dev team to see if someone can look into it further and reproduce it consistently.

JaspalSuri avatar Oct 05 '21 07:10 JaspalSuri

I was able to reproduce this using a unicode pad on my Android. The content after the null character was not visible on the Android, but opening the note in web browser shows the null character as the weird box, and content after. I cannot manually insert the null character in Firefox on Ubuntu (using ctrl+shift+u) as the browsers seems to prevent it.

EDIT: tried re-opening notes in the other editors, this appears exclusive to the plain editor. Tried all four MD editors, bold, plus, and code.

tab0r avatar Nov 26 '21 17:11 tab0r