Hi Danielo
> I'd suggest adding a console.log to the top of each of your functions so
>> that you can see what is being called.
>>
> The problem is that I can't open a console in Tasker's webview. I should
> log it to a file. It's enough to write a function that writes to the file
> or should I use some kind of logger?
>
That's always awkward. A lot of the time one can use alert(), but it
doesn't always play well with asynchronous code. Logging to the DOM with
something like this can be useful:
document.body.appendChild(document.createTextNode("My message------"))
You won't get line breaks in the output, hence the dashes to separate
messages.
>
>
>> I notice that the deleteTiddler() method is commented out, and that it
>> doesn't call the callback; if it is in fact being called by the syncer then
>> that would be a problem.
>>
> What kind of problem? What would be the easiest option for this?
>
The syncer is calling deleteTiddler() expecting that it will at some point
invoke the callback, with either success or failure. If the deleteTiddler
method just exits, without calling the callback, the syncer will never get
the chance to kick off the next sync task. I'd suggest first adding logging
so you can tell whether the method is being called. If necessary, you could
mock the function by just calling the callback with the success parameters.
Good luck,
Best wishes
Jeremy
>
>> I suspect that will be because TW is attempting to run the syncadaptor on
>> the server as well as in the browser. The fix is to only export your
>> syncadaptor in the browser:
>>
>> if($tw.browser) {
>> exports.adaptorClass = FileSystemAdaptor;
>> }
>>
>> I'll try that out! Thank you
>
>
>> Best wishes
>>
>> Jeremy.
>>
>> --
>> Jeremy Ruston
>> mailto:[email protected]
>>
>
--
Jeremy Ruston
mailto:[email protected]
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywikidev/CAPKKYJaC1YVMPevWe8-jqRtJnhxYWbL-CW7TM_A610pwPUa%3DyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.