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)), '..');