PUT /panels/ carries a version and refuses a stale one with 409

The Panels dialog re-reads the list on 409. A panels.json without a
version reads as 0.
This commit is contained in:
2026-10-15 10:07:50 +02:00
parent 589ddecbb1
commit 43498037be
10 changed files with 108 additions and 10 deletions
+4 -1
View File
@@ -107,6 +107,7 @@ test.beforeAll(async ({ browser }) => {
...existing,
{ id: flowName, title: "Hall", dashboards: [first, second] },
],
version: config.version,
},
})
await page.close()
@@ -116,7 +117,8 @@ test.afterAll(async ({ browser }) => {
// Restoring the list is also what removes this spec's own panel.
if (panels) {
const page = await apiPage(browser)
await api(page, "/panels/", { method: "PUT", data: { panels } })
const { version } = await (await api(page, "/panels/")).json()
await api(page, "/panels/", { method: "PUT", data: { panels, version } })
await page.close()
}
await deleteAll(browser, [
@@ -240,6 +242,7 @@ async function setTouch(page: Page, touch: boolean) {
panels: (config.panels ?? []).map((panel: PanelDef) =>
panel.id === flowName ? { ...panel, touch } : panel,
),
version: config.version,
},
})
}