spacecowboy / NotePad

Now under new management
GNU General Public License v3.0
381 stars 158 forks source link

Org syncing might have issues with Org-like syntax in notes? #540

Open Imberflur opened 3 months ago

Imberflur commented 3 months ago

Describe the bug

It seems like using * can cause one note to be split up when syncing is enabled. Additionally, I think I observed a # on the start of the second line of a note causing that line to be omitted when syncing is enabled.

At least, these are the two cases I observed. There might be other patterns that get misread as Org syntax.

While trying to figure out how to transfer my notes to a new device, I enabled syncing briefly before realizing that the backup mechanism was what I needed. Later on, I realized several notes were split up, I thought this might be an issue with the backup process but when checking my old device the issue was there too. The splitting corresponded with *s in the original notes, after investigating what enabling syncing does and looking at the Org syntax, I strongly suspect something in the Org-sync process is interpreting this content as part of the syntax causing multiple notes to be created (thankfully, I figured out how to copy out the org files from my old device and it looks like they have the information to reconstruct my original notes).

how To Reproduce

I will try to test this after I finish reconstructing my notes, but I suspect this would reproduce the issue: This reproduces the issue:

  1. Create a multi-line note with the second line starting with # as well as additional lines some of which start with *. e.g.

    My test note
    # Line starting with hash
    some text
    * some
    * bullet
    * points
    more text
  2. Enable syncing:

    1. Toggle on "Enable synchornization" and "SD card sync" under ⋮->Settings->Syncing.
    2. Go back to main view and select "Sync" from the menu.
  3. See note split at every * into a separate note and the second line with # missing entirely.

(note this doesn't require an SD card to be present to reproduce, but the SD card sync setting needs to be toggled on afaict)

The expected result is for the note content to be fully preserved. While waiting for a fix and/or if there are significant feasibility issues with fixing it, it could be useful to include a warning about this when enabling syncing.

Technical information

P.S. Thanks for this software, I hope this report is helpful!

CampelloManuel commented 2 months ago

Thanks for the detailed report, I will investigate, but I admit that I don't use this feature, so I don't think a solution will come soon

Imberflur commented 2 months ago

I will note I also don't use this feature. For me, the main issue was that enabling it while experimenting with options ended up corrupting my notes.

So I'm not in a rush for a solution.