Tomboy notes are not converted to XML on Tomboy sync

Bug #527335 reported by Roman Yepishev
46
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Ubuntu One Servers
Fix Released
High
Rodrigo Moya

Bug Description

STR:

0. Reset tomboy note sync so that it is in clear state.
1. Create a new HTML note with the following content via futon:

{
   "_id": "0781989f6f7c4778b2b3c3d2c0437109",
   "_rev": "5-f1826e7fb80104baf7ebf5cc950f0461",
   "create_date": "2010-01-22T19:39:47.0000000+02:00",
   "application_annotations": {
       "Tomboy": {
           "last-sync-revision": 8,
           "open-on-startup": false,
           "pinned": false,
           "last-metadata-change-date": "2010-01-22T21:40:44.2713230+02:00",
           "tags": [
           ]
       }
   },
   "title": "I am a HTML note",
   "last_change_date": "2010-01-22T21:40:44.2713230+02:00",
   "content": "I am a note in HTML format<br><br><br><br><br>I am so HTML!",
   "record_type": "http://www.freedesktop.org/wiki/Specifications/desktopcouch/note",
   "record_type_version": "1.0"
}

(This is available at http://paste.ubuntu.com/383877/ as well )

2. Wait until the note is replicated to u1
3. Perform tomboy note sync.

Actual result:

Note sync fails with no error displayed in the UI but with the following printed to the terminal:

[INFO]: Initializing Mono.Addins
[ERROR]: Synchronization failed with the following exception: 'br' is expected Line 6, position 64.
  at Mono.Xml2.XmlTextReader.Expect (System.String expected) [0x00000]
  at Mono.Xml2.XmlTextReader.ReadEndTag () [0x00000]
  at Mono.Xml2.XmlTextReader.ReadContent () [0x00000]
  at Mono.Xml2.XmlTextReader.Read () [0x00000]
  at System.Xml.XmlTextReader.Read () [0x00000]
  at Tomboy.Sync.NoteUpdate..ctor (System.String xmlContent, System.String title, System.String uuid, Int32 latestRevision) [0x00000]
  at Tomboy.WebSync.WebSyncServer.GetNoteUpdatesSince (Int32 revision) [0x00000]
  at Tomboy.Sync.SyncManager.SynchronizationThread () [0x00000]

(/usr/lib/tomboy/Tomboy.exe:12737): GLib-CRITICAL **: g_source_remove: assertion `tag > 0' failed

Expected result:
Note sync is performed correctly.

You will also see that the note in couchdb is not converted to XML for future lossless sync and note_format is not added.

Note sync seems to be performed correctly for new notes that are stored in XML format from the start.

As you can see, the parser expects closing </br> but it also means that <br>s got sent to Tomboy which is not right since Tomboy XML uses CR/LF characters for new lines i.e. conversion is not done.

See also: bug 406816 and bug 501020, comment #32.

Roman Yepishev (rye)
visibility: private → public
Roman Yepishev (rye)
tags: added: desktop+ notes webui
Changed in ubuntuone-servers:
importance: Undecided → High
assignee: nobody → Ubuntu One Desktop+ team (ubuntuone-desktop+)
Revision history for this message
Rodrigo Moya (rodrigo-moya) wrote :

I've tried with several of my notes stored still in HTML on the server, adding <br>'s and &, and the conversion seems to be ok. So not sure where d.oes this come from. Shouldn't this already be fixed by the close-brs branch? If the HTML has a <br> the code replaces it with the correct <br/>

Changed in ubuntuone-servers:
assignee: Ubuntu One Desktop+ team (ubuntuone-desktop+) → Rodrigo Moya (rodrigo-moya)
Revision history for this message
Roman Yepishev (rye) wrote :

Rodrigo, <br/> is not a valid value for Tomboy notes anyway.

Here's the complete STR.

Create a document in local couchdb in /notes/:

{
   "_id": "0781989f6f7c4778b2b3c3d2c0437109",
   "_rev": "5-f1826e7fb80104baf7ebf5cc950f0461",
   "create_date": "2010-01-22T19:39:47.0000000+02:00",
   "application_annotations": {
       "Tomboy": {
           "last-sync-revision": 8,
           "open-on-startup": false,
           "pinned": false,
           "last-metadata-change-date": "2010-01-22T21:40:44.2713230+02:00",
           "tags": [
           ]
       }
   },
   "title": "I am a HTML note",
   "last_change_date": "2010-01-22T21:40:44.2713230+02:00",
   "content": "I am a note in HTML format<br><br><br><br><br>I am so HTML!",
   "record_type": "http://www.freedesktop.org/wiki/Specifications/desktopcouch/note",
   "record_type_version": "1.0"
}

( http://paste.ubuntu.com/383877/ )

As you can see, it contains HTML in content and no note-format/note_format field.

Now wait until replication is performed and try to sync the notes with Tomboy. You will experience the error I described.

I have also added <h1>test</h1> node into that note and removed <br>s so that parser does not fail. Upon note sync, tomboy ignores <h1> node and the note does not look like it is converted. note_format does not appear on the server side and it looks like the conversion is done only when the note is edited via webui, not when note sync is performed by tomboy.

Roman Yepishev (rye)
description: updated
Revision history for this message
Cornelius Hald (hald) wrote :

I came across this bug as well, when I was connecting to an testing account that I've not used for some time now. There are just two notes. Both just contain around 3 words, without any formatting or special characters. The data returned from U1 to Tomboy looks like this:

{"notes": [{"note-content": "sadsadsa<br><br>", "open-on-startup": false, [...]

Please note the two <br> tags behind "sadsadsa".

Changed in ubuntuone-servers:
status: New → Fix Committed
Revision history for this message
Twisted Lucidity (lucidlytwisted) wrote :

I've just tested this at home on my Windows box where it was failing (Tomboy on Ubuntu was always fine) and it seems to be working now.
Thanks for the hard work!

Changed in ubuntuone-servers:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.