The terms version and revision might sound familiar (if you are programming without version control, drop this book right now and start learning one of the popular systems). Using new versions for document changes works a lot like version control, but there’s an important difference: CouchDB does not guarantee that older versions are kept around.
Thank you for the explanation. I am not asking about what the _rev is used for in CouchDB. I am asking about how the TW5 app (syncer and the app in general) handles the revision field, especially:
* why the updated revision returned from saveTiddler is not stored in the tiddler itself
* why a new draft tiddler's revision is set to the original tiddler's revision instead of null
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 tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.
OK, is there a way of getting the newest revision from the syncer's
tiddlerInfo inside the saveTiddler method? Maybe it could be passed to
saveTiddler like it is passed to deleteTiddler?
This would probably
fix both issues since the sync adaptor can store the server revision
inside the tiddlerInfo and distinguish between a draft tiddler it has
not seen before (that has the original tiddler's revision) and a draft
tiddler that already exists on the server.
I ran into another problem with the syncer: after a tiddler is
succesfully deleted on the server, the syncer's tiddlerInfo for that
tiddler is not cleared. This caused problems when editing a tiddler
twice. The draft tiddler is deleted on save but the tiddlerInfo for
the draft tiddler is still there, causing the code to send a revision
ID to the server that is not there when editing the tiddler again.
Also, is it possible to add HTTP 201 (Created) to the list of
allowable response codes in core/modules/utils/dom/http.js?
Regards,
William
--
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 tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.
Thanks for the comments. I am leaving it there just in case any users
want to use a field name starting with "_". This will cause errors in
CouchDB since names starting with an underscore in the root object are
reserved.
Before I write the instructions, I have questions about where to put
the files for my custom edition. Should I just put it in the
repository?
Also there is a question of how the adaptor can best find the server
and the database name. I can probably edit the code to assume it is
always served from within couchdb and derive the database and the
design document name from the document's URL. However this does make
it harder to serve the app from another web server. What do you think
about forcing the user to edit a system tiddler and rebuild the
TiddlyWiki if they need to point it to another server?
The simplest way to get things running for people with no expertise is
probably to replicate the whole database from an empty instance.:
1. Create new database
2. Replicate from URL
3. Done
Of course, this means I have to maintain an empty instance and
regularly update it. Alternatively the push shell script in the github
repo can be used.
Regards,
William
--
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 tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.
Thanks for the advice. I am now trying to clean up the build process
and document it.
> A reasonable strategy might be to default to deriving the database and design document from the URL, but to enable them to be overridden with system tiddlers. The TiddlySpot saver does something similar composing the upload URL from the wikiname, but allowing it to be overridden with the $:/UploadURL system tiddler.
Where will this updated system tiddler be stored? Will the users be
building the edition themselves with an updated $:/UploadURL coded
inside the HTML?
tiddlywiki edition/ --verbose --output out --rendertiddler $:/core/save/all index.html text/plain
node_modules/.bin/couchapp.cmd push couchapp.js myUrl
tiddlywiki.cmd .\edition --serverAnyway, I can't see how building the HTML file can help to upload the correct template to couchdb since it just sents a JS file