mirror of
https://github.com/openchamber/openchamber.git
synced 2026-11-23 17:01:19 +08:00
On a poor connection (for example over the private relay) the first save of a new project session draft could fail. Its text stayed in the composer's local storage under the draft's own id, but the sidebar row came only from the server, so after leaving the screen nothing led back to it and a new draft opened empty. A failed save now keeps the draft as an unsynced entry with its own row, persisted in localStorage (attachment ids without bytes, merged per entry so windows don't overwrite each other), shown before the server's list arrives, and sent again after each successful list read. A 413 is not resent until the draft changes, a draft the server never had is discarded without an error, and a failed move leaves the draft where its local text lives. Tested in an isolated dev instance with draft writes blocked: type, leave, reload offline, reopen the row, reconnect; plus store tests for the retry, the stored copy and the offline discard.