tomboy-notes / tomboy-ng

Next generation of Tomboy
MIT License
389 stars 38 forks source link

syncing with gnote, End-Tag is missing for 'text' #195

Closed oppiman closed 4 years ago

oppiman commented 4 years ago

First of all thanks for this project. Second, yes, I know, odd request. I had tomboy running and syncing between Linux Mint Mate and W10, both using a folder that actually has been synced with syncthing. No issues. Then I moved from Mate to LMDE and it told me to use Gnote instead of Tomboy. Well I did and all worked, even the sync to Tomboy. Now I tried to sync to the Gnote sync folder. tomboy-ng found all notes, but none showed. They all snapshot/recover lost notes/existing notes. I can get them all back by doubleclicking each one of it. Nothing distorted. The error message is: End-Tag is missing for 'text'

davidbannon commented 4 years ago

No, not odd, you should, IMHO expect Tomboy, tomboy-ng and g-Note to sync together. But I don't test G-Note and maybe its changed some things ?

I am a bit puzzled as to why you use syncthing, it should not be necessary and it won't be aware of the meta data that Tomboy/tomboy-ng/g-note use to get syncing right, especially if more than two nodes are sync'ed.

Anyway, your problem ? Just so I understand, can we clarify -

"...Well I did and all worked, even the sync to Tomboy."

"Now I tried to sync to the Gnote sync folder."

Just what worked and what did not ?

It sounds like the notes ended up being marked as 'bad notes by tomboy-ng, that sounds like bad xml. The error message, " End-Tag is missing " is a strange one, but it sounds like some bad xml too. But I don't think that message came from tomboy-ng did it ? Can you tell me just where that message popped up please ? Was it a popup box or list where the bad notes are displayed ?

Could you send me one of the notes, before they have been recovered ? It would also be useful if you knew the history of the bad note, where was it last edited (in which application ?)

Davo

oppiman commented 4 years ago

Thanks for your reply. Why syncthing? Well the Linux system and the Windows system are not in the same network. I use syncthing for several folders and it happened that I used it for Tomboy as well. That worked a few years, so I left it that way.

What worked? Having Tomboy on the Linux and Windows system and sync to a folder that is being replicated with syncthing.

Now I started to use Tomboy-ng on a new W10 system. The old got retired. So again just 2 systems involved. Same syncthing setup. I pointed the fresh Tomboy-ng to the synced Gnote folder. It found all my notes (the count was correct), but they did not show up lateron. So in Tomboy-NG in Settings/Snapshot/Recover Lost Notes/Existing Notes all my notes were listed. And all had the same error message in the list. In 'file:///my-path-name.some-GUID.note' (line XX pos 1): End-tag is missing for 'text'

I doubleclicked each single note. I popped up, looked good and I closed it. Then I exited Tomboy-ng and started it again. All notes visible, all looks good. I synced. Checked on my Linux box in Gnote. It saw all notes changed, I let them sync back. All looks good. I synced. Checked Tomboy-NG, all looks good. Back to Gnote on the Linux box and changed a note and synced. Back to Tomboy-ng on Windows and it received one change and put it again under Settings/Snapshot/Recover Lost Notes/Existing Notes, same error.

So it seems GNote does something to a note that Tomboy-ng can't handle. But Gnote can handle what Tomboy-ng does.

Hope I could explain well enough.

davidbannon commented 4 years ago

You have explained it very well oppiman. I now understand how you use syncthing, Tomboy(-ng) -> SyncFolder -> SyncThing -> DifferentSyncFolder -> Tomboy-ng

That should work fine !

But the rest of your message does worry me, it sounds like Tomboy or tomboy-ng does not like the notes being written by gNote. I don't have a GNote install and would need to bring up a VM to make one so, could you please send me a a gnote note file ? Pick one that has nothing personal in it, probably need to zip it up (tar.gz) to attach to these messages here.

I don't know but I would expect gnote note files would be in $HOME/.local/share/gnote directory or something similar. They have a long file name and an extension of .note. You can cat them out to the screen and read the text through the messy XML to check the content, do check what you send, anyone can see it here.

If you make a new note, just put some text in it and save it, it will be at the bottom of the list when you type -

ls -ltr ~/.local/share/gnote/*.note [enter]

Davo

davidbannon commented 4 years ago

Actually oppiman, don't bother to send me that note, I realised I had gnote in one of my Linux Mint Test VMs, one I use for release testing. So, I fired up gnote and can confirm it writes xml that tomboy-ng cannot read.

Seems to write all the trailing note meta data in one long line, thats usually legal xml (but ugly). I will have to take a closer look and try and work out why my xml parser cannot handle it, maybe its too long for a buffer ?

Right now, I am afraid we have to say that tomboy-ng and gnote do not play nicely together. While I might be able to fix it, perhaps installing tomboy-ng on your linux machine might be a good idea.

Davo

davidbannon commented 4 years ago

OK, seems to be a number of problems. gnote writes its trailing meta data quite differently in a number of aspects, these are things that are ok xml but are not what Tomboy does and tomboy-ng makes some assumptions that are, in gnote's case, invalid -

  1. It writes all the trailing note metadata in one long line.
  2. It writes its date time strings in UTC format (ie zulu time) rather than the Timeoffset model.
  3. It leaves out the X and Y positional data.
  4. It leaves out the open-on-start data.

At present, this presents a number of problems. Because I suspected it was possible that data would arrive without the timeoffset (item 2) values, I test for that and rewrite if necessary. However, I assumed it would be nicely formatted, in the original Tomboy style and the broken timedate values would each be terminated with a newline. But (item 1) its all one long line.

Some early tomboy notes also left out the X and Y data (item 3) so I do already handle that. I don't handle missing open-on-start (4) because I have not seen a note that left it out, I guess that's relatively easy to fix.

So, sorry Oppiman, right now, tomboy-ng cannot read gnote files. Depending on how I get on with some other issues on my plate at the moment, maybe I will attempt to fix this for the next release. A bit disappointing that gnote has chosen to vary what Tomboy has done for a very long time.

Davo

Sigh.

oppiman commented 4 years ago

Wow, thanks for the analysis. I don't mind switching to NG on all my systems. I liked Tomboy more than Gnote anyway, only moved to it because of other X and Windowmanager related problems in LMDE.

Michael

davidbannon commented 4 years ago

I have committed some fixes that address this issue, Can now handle 'Zulu' datestrs, ones without timezone, with 'Z'. Will be in v0.30 Thanks for reporting this, good to have it under control ! Davo

oppiman commented 4 years ago

Thanks again. GTK2 64bit seems to play nicely with LMDE. I will test 0.30 again with Gnote anyway. (Now totally unrelated, I might give up syncthing for that type of sync and move to Nextcloud synced folder)

davidbannon commented 4 years ago

Sorry, tomboy-ng will not sync to nextcloud. If its on a server you can ssh to, then sshfs is your friend. A lot less infrastructure then Apache/Nextcloud/Graphel .... Davo

oppiman commented 4 years ago

ssh yes, but not from both (all) systems. No native Nextcloud (webdav) sync, just like before, sync to local folder, local folder gets picked up be Nextcloud app. No worries for you, thanks again.

oppiman commented 4 years ago

btw, sync using lovcal folder with Nextcloud works (Windows<>Linux). And I tried NG on lmde once with GTK2 64bit and another system with QT5 packages. Both work.