From 87a15a7d3394234ee139e8bbbaa0369dff3a0a47 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 24 Nov 2026 10:02:54 +0000 Subject: [PATCH] :books: Clarify plugin save failure recovery Describe rejection while the error remains and refer to persistence for recovery on file reopening or role changes. AI-assisted-by: gpt-6.1-terra --- .serena/memories/frontend/plugin-save-events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.serena/memories/frontend/plugin-save-events.md b/.serena/memories/frontend/plugin-save-events.md index 95f9363487..39f491eb94 100644 --- a/.serena/memories/frontend/plugin-save-events.md +++ b/.serena/memories/frontend/plugin-save-events.md @@ -2,7 +2,7 @@ - Start at `app.plugins.persist` for `penpot.waitForSave` and `app.plugins.events` for `contentsave` and `contentrollback`. The runtime forwarder requires `content:read` for `waitForSave`; new event names must also be added to runtime `validEvents`, and a stale runtime build can reject them. - `waitForSave(timeout?)` observes the shared persistence queue, not only the plugin's commits. Its default timeout is 60 seconds. It waits briefly for incoming commits, capped by the timeout; if work is pending it forces persistence and races settlement against rollback start or completion. A rollback must reject even if the status later becomes `:saved`. See `mem:frontend/workspace-persistence`. -- An earlier `:error` rejects even when no work is pending: a slow retry produces `save-retrying`, while a terminal failure keeps rejecting until the file is reopened. Other error codes include `save-timeout`, `rolled-back` and the stored failure code (default `save-failed`). Timeout validation accepts a positive finite number up to `u/max-timeout`; rejection must be an `Error`, not a string. +- An earlier `:error` rejects even when no work is pending: a slow retry produces `save-retrying`, while a terminal failure keeps rejecting while the error remains. Reopening a file or a role change can trigger recovery; see `mem:frontend/workspace-persistence` for its conditions. Other error codes include `save-timeout`, `rolled-back` and the stored failure code (default `save-failed`). Timeout validation accepts a positive finite number up to `u/max-timeout`; rejection must be an `Error`, not a string. - `contentsave` is a debounced state watch for transitions to `:saved` and passes no value. It does not prove the buffer is empty. - `contentrollback` subscribes to `::dps/rolled-back`, not the state watch. It is not debounced and is delivered asynchronously after reverted or reloaded data is in state. Its `{fileIds, pageIds, shapeIds}` payload comes from page-shape redo changes in reverted commits. Remove the stream subscription when the listener is removed. - MCP forwards rollback notices with task responses and retains unsent notices in per-file plugin local storage when available. Delivery is not an end-to-end acknowledgment; for its storage permissions, handoff and failure limits see `mem:mcp/save-and-rollback`.