Skip to content

Commit

Permalink
Update mergeTiddler.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
linonetwo committed Mar 19, 2024
1 parent b9b64bd commit 03b4ce4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/tw-mobile-sync/data/mergeTiddler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export function mergeTiddler(a: ITiddlerFields, b: ITiddlerFields): ITiddlerFiel
}
// both is string tiddler, we can merge them using diff-match-patch algorithm
// FIXME: Currently not working, it needs `c` that is an older version from server to work (3-way-merge), otherwise it will just use `b.text` as the merged text
// FIXME: `Error when processing tiddler { title: '2024-03-19T13:45:00+08:00', created: '20240319063429986', creator: '林一二', startDate: '20240319054500000', endDate: '20240319063000000', calendarEntry: 'yes', tags: 'xxx', modified: '20240319063429986', modifier: '林一二', caption: 'yyy', type: 'text/vnd.tiddlywiki', text: '' } Error: Unknown call format to make() at make ($:/plugins/linonetwo/tw-mobile-sync/server-sync-v1-endpoint.js:1:19900) at mergeTiddler ($:/plugins/linonetwo/tw-mobile-sync/server-sync-v1-endpoint.js:1:25987) at $:/plugins/linonetwo/tw-mobile-sync/server-sync-v1-endpoint.js:9:1558 at Array.forEach (<anonymous>) at Object.handler2 [as handler] ($:/plugins/linonetwo/tw-mobile-sync/server-sync-v1-endpoint.js:9:1426) at IncomingMessage.<anonymous> ($:/core/modules/server/server.js:308:10) at IncomingMessage.emit (node:events:517:28) at endReadableNT (node:internal/streams/readable:1368:12) at processTicksAndRejections (node:internal/process/task_queues:82:21)`
const patches = makePatches(a.text, b.text);
const [mergedText] = applyPatches(patches, a.text);
const fields: ITiddlerFields = {
Expand Down

0 comments on commit 03b4ce4

Please sign in to comment.