si.adaptor.PutTiddler is not a function error during sync in TW 2.5.2

11 views
Skip to first unread message

rouilj

unread,
Jul 27, 2009, 9:02:44 PM7/27/09
to TiddlyWiki
Hello all:

I have been having an issue with sync not working properly. I have
seen a couple of other
reports as well. I finally broke out firebug to see if I could figure
out what's happening.
I am using tw 2.5.2 in firefox 3.5.1. The portion of code
"config.macros.sync.doSync = function(e)"
reads:

case sl.changedBoth:
r = si.adaptor.putTiddler(si.tiddler,null,si,putTiddlerCallback);
break;
default:

I pull up the sync popup from the backstage menu, I leave checked one
item, StorySaverPluginInfo
(from tiddlytools.com) which I changed locally.
Then I set firebug to break on error. After I click on the sync button
I get:

si.adaptor.putTiddler is not a function

and it indicates the line I quote above.

I have looked through the code and don't see any place where this
function adaptor.putTiddler is
getting defined (or redefined for that matter). The code looks the
same in my 2.5.2 empty.html
as well as my 2.5.2 working copy. I can reproduce it by:

* dowloading an empty 2.5.2
* import the ImportTiddlersPlugin from http://www.tiddlytools.com.
* edit the ImportTiddlersPlugin (add a space or something)
* save empty.html
* reload empty.html
* open sync from backstage, (ImportTiddlersPlugin should show
"shanged while unplugged")
and hit the sync button

Does anybody have any ideas on how to solve or further debug this?

-- rouilj

rouilj

unread,
Jul 27, 2009, 9:06:44 PM7/27/09
to TiddlyWiki
Forgot to mention I am running Firefox 3.5.1, but it was also an issue
with FF 3.0.11 on windows XP SP3.

-- rouilj

FND

unread,
Jul 28, 2009, 5:35:57 AM7/28/09
to Tiddl...@googlegroups.com
> I have been having an issue with sync not working properly

The problem here is that sync recognizes there are local changes.
So when synchronizing, it tries to push those changes to the originating
server (otherwise you'd lose your local changes).

However, in your case, the origin is just a TiddlyWiki document - i.e. a
static HTML file - which by its nature cannot accept such changes from
remote clients.
That's why there's no putTiddler method in the built-in FileAdaptor.

The situation would be quite different with most other adaptors*, since
they usually connect to a server-side script which is capable of
processing inputs.

Having said that, we realize the user experience here leaves a lot to be
desired. Any contributions in this area would be very welcome.

In the meantime, here's a simple workaround that at least prevents the
exception from being thrown and gives a tiny bit more information:
---------------
(function() {

var orig = config.macros.sync.doSync;
config.macros.sync.doSync = function(ev) {
try {
orig.apply(this, arguments);
} catch(ex) {
if(ex.name == "TypeError) {
displayMessage("sync operation unsupported: " + ex.message);
} else {
displayMessage("sync failed: " + ex.message);
}
}
};

})();
---------------


-- F.


* http://tiddlywiki.org/wiki/Server_Adaptor_Mechanism

FND

unread,
Jul 29, 2009, 8:30:49 AM7/29/09
to Tiddl...@googlegroups.com
> In the meantime, here's a simple workaround that at least prevents the
> exception from being thrown and gives a tiny bit more information

Something similar has now been implemented in the core:
http://trac.tiddlywiki.org/ticket/1111

There'll probably be a bugfix release soon, which will include this change.


-- F.

rouilj

unread,
Jul 29, 2009, 10:09:15 AM7/29/09
to TiddlyWiki
I'll keep an eye out for the bugfix release.

What would also be nice is support for something more along the lines
of the
ImportTiddlersPlugin. That supports:

1) merging the results of the new and old tiddlers
2) overwriting the local tiddler with the results from the
"master" (maybe with an optional
backup of the local tiddler although I use RevisionsPlugin and
usually mark my local
tiddlers so that they are backed up on save).

I often use the sync function to get updates after my changes (or
similar functionality)
has been put into the new tiddler. So I do want to overwrite (possibly
with backup)
the old tiddler with the new one.

-- rouilj

FND

unread,
Jul 29, 2009, 10:22:44 AM7/29/09
to Tiddl...@googlegroups.com
> What would also be nice is support for something more along the
> lines of [...]

> 1) merging the results of the new and old tiddlers
> 2) overwriting the local tiddler with the results from the "master"

I agree that's very useful and desirable - however, I don't think it
should be part of the basic core functionality.
So having a generic plugin for this would be great.


-- F.

Reply all
Reply to author
Forward
0 new messages