From 33bee61f2c6efdca7ddba742c384a52f46d23dec Mon Sep 17 00:00:00 2001 From: Shakker Date: Mon, 10 Aug 2026 11:19:36 +0200 Subject: [PATCH] test: cover ownerless staged attachment cleanup --- CHANGELOG.md | 2 +- .../chat/chat-pane-browser-annotation-lifecycle.test.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ed3e7d11477..a890ec050630 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,7 +67,7 @@ Docs: https://docs.openclaw.ai ### Fixes -- **Control UI staged attachments:** preserve unsent images, files, pasted images, and large pasted text across same-tab route and narrow split-pane remounts while keeping pane close, session or Gateway ownership changes, application shutdown, and hard reload as cleanup boundaries. Fixes #121519. Thanks @shakkernerd. +- **Control UI staged attachments:** preserve unsent images, files, pasted images, and large pasted text across same-tab route and narrow split-pane remounts while keeping pane close, mismatched pane/session/Gateway remounts, application shutdown, and hard reload as cleanup boundaries. Fixes #121519. Thanks @shakkernerd. - **Control UI browser annotations:** keep marked screenshots and generated page context together in structured composer cards, preserve user-written drafts when annotations are removed or replaced, retain complete unsent annotation packages across same-tab route and active split-pane remounts, and offer bounded Undo without restoring removed context into another session. Fixes #120744. Thanks @shakkernerd. - **Control UI profile avatar refreshes:** carry canonical content revisions through mutation responses and live presence so rapid replacements refresh every connected browser without stale cache rollback. Thanks @shakkernerd. - **Control UI appearance accessibility:** keep the unavailable custom-theme card announced as an Import command while preserving selected-state semantics for selectable themes and text sizes. Thanks @shakkernerd. diff --git a/ui/src/pages/chat/chat-pane-browser-annotation-lifecycle.test.ts b/ui/src/pages/chat/chat-pane-browser-annotation-lifecycle.test.ts index ed3ebbf74d2a..2e370f2d3c06 100644 --- a/ui/src/pages/chat/chat-pane-browser-annotation-lifecycle.test.ts +++ b/ui/src/pages/chat/chat-pane-browser-annotation-lifecycle.test.ts @@ -368,7 +368,7 @@ describe("staged attachment composer adoption", () => { expect(getChatAttachmentDataUrl(ordinary)).toBeNull(); }); - it("discards an annotation captured without a client when the first client arrives", () => { + it("discards a staged package captured without a client when the first client arrives", () => { const client = {} as GatewayBrowserClient; const { pane, state } = createTestChatPane({ client, @@ -381,6 +381,8 @@ describe("staged attachment composer adoption", () => { pane as TestChatPane & { receiveBrowserAnnotation: (candidate: Event) => void } ).receiveBrowserAnnotation(annotationEvent()); const annotation = state.chatAttachments[0]!; + const ordinary = storedAttachment("no-client-ordinary", false); + state.chatAttachments.push(ordinary); pane.applyGatewaySnapshot({ ...pane.context.gateway.snapshot, @@ -391,6 +393,7 @@ describe("staged attachment composer adoption", () => { expect(state.chatAttachments).toEqual([]); expect(getChatAttachmentDataUrl(annotation)).toBeNull(); + expect(getChatAttachmentDataUrl(ordinary)).toBeNull(); }); it("invalidates annotation Undo when the logical Gateway client is replaced", async () => {