From db9978f8c2b35ff2e671eb4be47a9b5772b740ff Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Tue, 16 Apr 2024 11:59:52 +0100 Subject: [PATCH] Syncer should only save existing tiddlers if they have changed --- core/modules/syncer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/modules/syncer.js b/core/modules/syncer.js index f7627e1ac..f08e888b5 100644 --- a/core/modules/syncer.js +++ b/core/modules/syncer.js @@ -257,7 +257,11 @@ Save an incoming tiddler in the store, and updates the associated tiddlerInfo Syncer.prototype.storeTiddler = function(tiddlerFields) { // Save the tiddler var tiddler = new $tw.Tiddler(tiddlerFields); - this.wiki.addTiddler(tiddler); + // Only save the tiddler if it has changed + var existingTiddler = this.wiki.getTiddler(tiddlerFields.title); + if(!existingTiddler || !existingTiddler.isEqual(tiddler)) { + this.wiki.addTiddler(tiddler); + } // Save the tiddler revision and changeCount details this.tiddlerInfo[tiddlerFields.title] = { revision: this.getTiddlerRevision(tiddlerFields.title),