From 744cabda752100dcf75483a8289e1faf5625e78e Mon Sep 17 00:00:00 2001 From: SandObserver <260779319+SandObserver@users.noreply.github.com> Date: Sat, 3 Oct 2026 23:35:06 -0400 Subject: [PATCH] Fix: send the recorded list when a list save is retried after sign-in --- ui/admin/index.html | 2 +- ui/js/admin.js | 2 +- ui/test/admin-nav.test.mjs | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/admin/index.html b/ui/admin/index.html index 999cd018..0426cd82 100644 --- a/ui/admin/index.html +++ b/ui/admin/index.html @@ -301,6 +301,6 @@

General

- + diff --git a/ui/js/admin.js b/ui/js/admin.js index 4e02b67e..2031b071 100644 --- a/ui/js/admin.js +++ b/ui/js/admin.js @@ -161,7 +161,7 @@ async function writeItems(asked) { throw Object.assign(new Error('stale'), { status: 409 }); } const sent = JSON.stringify(state.items); - full.items = state.items; + full.items = JSON.parse(sent); const r = await apiPost('/api/config', full); _serverItems = JSON.stringify(r.items); _savedItems = sent; diff --git a/ui/test/admin-nav.test.mjs b/ui/test/admin-nav.test.mjs index 0be91d0a..68b72640 100644 --- a/ui/test/admin-nav.test.mjs +++ b/ui/test/admin-nav.test.mjs @@ -67,6 +67,11 @@ test('list saves run through one queue and undo through one reverting save', () src, /_serverItems = JSON\.stringify\(r\.items\);\s*_savedItems = sent;\s*saveOrRestore\.landed\(JSON\.parse\(sent\)\);/, ); + assert.match( + src, + /const sent = JSON\.stringify\(state\.items\);\s*full\.items = JSON\.parse\(sent\);/, + 'a retry after sign-in sends the body again; it must hold the list recorded as sent, not the live one', + ); }); const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');