test: cover ownerless staged attachment cleanup

This commit is contained in:
Shakker
2026-08-10 11:19:36 +02:00
parent c5a5ba2263
commit 33bee61f2c
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -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.
@@ -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 () => {