From 185d0fcd3702b3968ef60bff96edfa4a9714d502 Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Fri, 11 Sep 2026 19:24:17 +0200 Subject: [PATCH] fix: drop a refused discard's parked delete so a page close keeps it Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01ViTUkt4czrvZdxdWwxqRAQ --- frontend/src/lib/itemStore.svelte.ts | 3 +++ frontend/src/lib/itemStore.test.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/frontend/src/lib/itemStore.svelte.ts b/frontend/src/lib/itemStore.svelte.ts index db2c37f26c..b2cb1561bd 100644 --- a/frontend/src/lib/itemStore.svelte.ts +++ b/frontend/src/lib/itemStore.svelte.ts @@ -390,6 +390,9 @@ class Entry { await this.settleRows([this.key]) // The row is the item: while its delete has not landed, the item is still there. if (this.rowRefused(this.key)) { + // The syncer keeps a failed payload for its page-close flush; that delete would + // remove the item this reports as kept. + this.ports.dropPending(this.key) this.row = keptRow this.replaceValue(kept) this.reconcile() diff --git a/frontend/src/lib/itemStore.test.ts b/frontend/src/lib/itemStore.test.ts index 2c69e1c72a..166e146011 100644 --- a/frontend/src/lib/itemStore.test.ts +++ b/frontend/src/lib/itemStore.test.ts @@ -395,6 +395,7 @@ describe('item store: origins', () => { expect(item.value).toEqual(draft) expect(item.status).toBe('failed') expect(rows.hints.get('u/me/r')).toBe(true) + expect(rows.dropped).toContain('u/me/r') }) it('creates under a temporary path, then moves to the real one and clears any row there', async () => {