From 1fcd09b89425d607b8747eeaa77eda001fa99841 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Fri, 8 May 2026 17:49:33 +0200 Subject: [PATCH 1/7] fix(Unidirectional|Merge): Use lower similarity threshold for folder similarity fixes #2230 Signed-off-by: Marcel Klehr --- src/lib/Scanner.ts | 2 +- src/test/test.js | 137 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+), 1 deletion(-) diff --git a/src/lib/Scanner.ts b/src/lib/Scanner.ts index ae712e5301..b761db183d 100644 --- a/src/lib/Scanner.ts +++ b/src/lib/Scanner.ts @@ -182,7 +182,7 @@ export default class Scanner this.mergeable(removedItem, createdItem) && (removedItem.type !== 'folder' || (!this.hasCache && - removedItem.childrenSimilarity(createdItem) > 0.8)) + removedItem.childrenSimilarity(createdItem) >= 0.5)) ) { this.result.CREATE.retract(createAction) this.result.REMOVE.retract(removeAction) diff --git a/src/test/test.js b/src/test/test.js index 20230f488d..1d9987ef34 100644 --- a/src/test/test.js +++ b/src/test/test.js @@ -2103,6 +2103,143 @@ describe('Floccus', function() { false ) }) + it('should move items without confusing folders (2)', async function() { + const localRoot = account.getData().localRoot + + const folder1 = await browser.bookmarks.create({ + title: 'a', + parentId: localRoot + }) + const folder2 = await browser.bookmarks.create({ + title: 'b', + parentId: folder1.id + }) + const folder3 = await browser.bookmarks.create({ + title: 'c', + parentId: folder2.id + }) + const folder4 = await browser.bookmarks.create({ + title: 'd', + parentId: localRoot + }) + const folder5 = await browser.bookmarks.create({ + title: 'e', + parentId: folder4.id, + }) + const folder6 = await browser.bookmarks.create({ + title: 'f', + parentId: folder5.id, + }) + const folderX = await browser.bookmarks.create({ + title: 'X', + parentId: folder3.id, + }) + await browser.bookmarks.create({ + title: 'url', + url: 'http://ur.l/', + parentId: folderX.id + }) + const folderX2 = await browser.bookmarks.create({ + title: 'X', + parentId: folder6.id, + }) + await browser.bookmarks.create({ + title: 'test', + url: 'http://urrr.l/', + parentId: folderX2.id + }) + const test2Bm = await browser.bookmarks.create({ + title: 'test2', + url: 'http://urrr2.l/', + parentId: folder1.id + }) + + await account.sync() // propagate to server + expect(account.getData().error).to.not.be.ok + + await account.sync() // make sure order is propagated + expect(account.getData().error).to.not.be.ok + + await account.init() // Remove the cache + + await browser.bookmarks.move(folderX.id, { parentId: folder2.id }) + await browser.bookmarks.move(folderX2.id, { parentId: folder5.id }) + await browser.bookmarks.move(test2Bm.id, { parentId: folderX.id }) + + await account.sync() // propagate to server + expect(account.getData().error).to.not.be.ok + + const tree = await getAllBookmarks(account) + expectTreeEqual( + tree, + new Folder({ + title: tree.title, + children: [ + new Folder({ + title: 'a', + children: [ + new Folder({ + title: 'b', + children: [ + new Folder({ + title: 'c', + children: [], + }), + new Folder({ + title: 'X', + children: [ + new Bookmark({ + title: 'url', + url: 'http://ur.l/', + }), + new Bookmark({ + title: 'test2', + url: 'http://urrr2.l/', + }), + ], + }), + ], + }), + ], + }), + new Folder({ + title: 'd', + children: [ + new Folder({ + title: 'e', + children: [ + new Folder({ + title: 'f', + children: [], + }), + new Folder({ + title: 'X', + children: [ + new Bookmark({ + title: 'test', + url: 'http://urrr.l/', + }), + ], + }), + ], + }), + ], + }), + ], + }), + false, + false + ) + + const localTree = await account.localTree.getBookmarksTree(true) + localTree.title = tree.title + expectTreeEqual( + localTree, + tree, + false, + false + ) + }) it('should integrate existing items from both sides', async function() { const localRoot = account.getData().localRoot From f2b78ad964efae5b51746b14fca60b244565e2c3 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Fri, 8 May 2026 17:55:30 +0200 Subject: [PATCH 2/7] fix: Run lint:fix Signed-off-by: Marcel Klehr --- src/ui/views/native/Home.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ui/views/native/Home.vue b/src/ui/views/native/Home.vue index 668ae360bc..a83362a993 100644 --- a/src/ui/views/native/Home.vue +++ b/src/ui/views/native/Home.vue @@ -1,13 +1,14 @@