Tomdroid - Tomboy note-taking on Android

SD card sync with Tomboy's folder structure

Reported by Konrad Voelkel on 2010-02-18
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Tomdroid
Wishlist
Unassigned

Bug Description

In the official Tomboy app, you can select "sync with a local folder", which I wanted to use to sync with my attached SDCard/Android device. Sadly, this "syncing" creates a folder structure where all note files are stored in the folder /tomdroid/0/0/, with /tomdroid/ containing only some manifest.xml.

It would be nice if either you would support non-flat folder hierarchies (probably quickly fixable) or you would write a Tomdroid sync plugin for Tomboy (probably just a patch for the usual folder-sync, so not a good idea).

Anyway, thanks for the good work so far!

Olivier Bilodeau (plaxx) wrote :

This is a great idea!

I wonder if everything will stay in 0/0/... or if it will change when you edit notes on another tomboy instance.

Maybe the way to go is to parse the manifest and use file names there?

I'll ask the tomboy guys what is the format with "sync with a local folder".

Changed in tomdroid:
assignee: nobody → Olivier Bilodeau (plaxx)
importance: Undecided → Wishlist
status: New → Confirmed

"Sync with local folder" is meant to point to a location that acts as a synchronization server. The normal use case is that a user sets up one common location that all Tomboy instances sync to, and then mounts it on their desktop somehow.

Using your phone as a sync server has some interesting connotations, but it is a lot more work than you realize. For one thing, the phone would always have to appear at the same mountpoint. For another, Tomdroid would have to properly implement the file system server (which is kind of a pain in the ass).

Most of the details for how this works are available in this file:
http://git.gnome.org/browse/tomboy/tree/Tomboy/Synchronization/FileSystemSyncServer.cs

SyncManager.cs is another good one, as it shows the sync algorithm, too.

The directory layout is a trick to keep directories "small". So the top-level "0" contains revisions 0-999, "1" would contains revisions 1000-1999, etc. This is all done in the file I linked above (see GetRevisionDirPath).

By the way, a long time ago I wrote some code to push all of your notes from Tomboy to Tomdroid. It wasn't the same as sync, but that didn't matter because Tomdroid didn't support note editing at the time. Here's a tarball of the add-in:
http://armstrong-clan.net/dump/TomdroidAddin.tar.gz

Still, I can't help but think that this is not the best way to support sync between Tomboy and Tomdroid. Let me explain:
1) The file system sync is very dependent on storing notes as XML files, but Tomdroid now stores the notes in SQLite in a format more compatible with the JSON format of the Tomboy Web REST API. So you'd have to do a bunch of converting to/from XML.
2) Everyone working on any kind of Tomboy sync right now is working on the web stuff, so the most work (including bugfixing) is going into web sync with Snowy, or U1, or whatever.
3) Maintaining a bunch of extra code for file-based sync is a pain in the ass and you will probably regret it as I now do. ;-)

If a user doesn't want to use U1 or Tomboy Online (launching later this year), or set up their own Snowy server, and what they really want to do is to use their phone as the server, you could always use Tomdroid as a server compatible with the Tomboy Web REST API. That would probably be a lot more maintainable, and you could do the sync over WiFi without having to plug in your phone.

Even so, I think the majority of users are going to just want to use a central server like Tomboy Online or U1. Adding sync server functionality to Tomdroid seems like a lot of work that won't be used by many users and will probably suffer from bug rot after a few months.

Or maybe I just need a nap. :-P

Olivier Bilodeau (plaxx) wrote :

All your references to tomdroid being a server scares me.. I just thought a quick parsing of the manifest and calling my xml note importer on the files with correct path instead of just loading *.note would be enough. I guess not.

I guess you are right, I should be spending my time on the web-sync and then all of this will become irrelevant.

But lets say "Sync from SD card" becomes "Import from SD card" then would adding all notes matching tomdroid/*/*.note be alright? Just asking..

Konrad, lets say we can sync with Ubuntu One read-only, would you still need "local folder sync"? or was the request because you need a convenient way to put all your notes into your android?

Konrad Voelkel (konradvoelkel) wrote :

Hmm I didn't think about the XML/SQLite issue. I would argue not to develop an approach to sync Tomdroid via Tomboy's filesync :-)

In an ideal world, I would want to do a quick U1 sync on the desktop, then a quick U1 sync on the Android device (in Tomdroid). I thought of the filesync approach as a workaround until the REST API is "finished enough". Maybe it is.

Anyway, if you already know how to parse the XML files, a little tweak of the Tomdroid file sync mechanism would suffice to provide a quick note import mechanism. This way I can do some more testing :-)

Read-only sync with U1 would certainly be much better.

Olivier Bilodeau (plaxx) on 2011-09-05
summary: - Sync with a local folder (in Tomboy) problems.
+ SD card sync with Tomboy's folder structure
Olivier Bilodeau (plaxx) on 2011-09-06
Changed in tomdroid:
assignee: Olivier Bilodeau (plaxx) → nobody
Allan Pratt (apratt-) wrote :

Bump. Some resolution on this bug is needed for me to use DropBox as my notes sync environment. See tomdroid bug 837119 for more about using DropBox.

When using DropBox for sync, tomdroid does not need to implement a file server or anything else funny, especially as long as it's read-only. Somebody else (DropBox by way of the Dropsync app) takes care of all the network/shared file stuff.

For the DropBox method to work, though, tomdroid does need to read the notes out of the manifest-and-subdirectory system, not as *.note files in the top-level SD card directory.

Stefan Hammer (j-4) wrote :

I just talked to the tomboy developer. Notes should be stored in one single folder without any hierachy.
Means: all your *.note files should be in $HOME/.local/share/tomboy/
If this is not the case, just move all notes there. Only one folder should stay in this location - the backup folder.
Notes will never get deleted, but they are moved into $HOME/.local/share/tomboy/backup/

So if there are folders colled 0 - remove them.
closing this bug report!

Changed in tomdroid:
status: Confirmed → Won't Fix
Allan Pratt (apratt-) wrote :

I don't understand why this bug is now closed. Manually copying the dropbox-synched notes to a single directory is not an option for me: it's not something I can or will do every time DropBox syncs my Tomboy notes folder.

Stefan, when you say "Notes should be stored in one single folder without any hierarchy," what do you mean by "should"? I have Tomboy on Linux configured to sync to local disk; this creates a file/folder hierarchy. Then I use DropBox to sync that folder hierarchy across multiple devices. Tomboy on both Linux and Windows play nicely in this environment, but Tomdroid does not. To me, that means there is still some work to do here.

Stefan Hammer (j-4) wrote :

oh... do you use the synchronisation feature of tomboy to sync the notes to a folder?
just don't do this. make a symlinkin your dropbox to the notes-folder (on linux: $HOME/.locla/shared/tomboy - on windows: %appdata%/ something,...).
Then you got rid of the folder hierarchy and you can easily sync!
Does this solve your problem?

yannack (yannack) wrote :

hi, I have the same issue. if I do as you suggest, with a symbolic link, then the desktop tomboy won't detect changes until it is restarted.
any suggestions?
thanks

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers