Cloud: Share with Me resends the refused start

Merged
TE
5d ago
+53-10

After Share with Me went through on a refused Cloud chat start, nothing happened until the person sent again (#29563, a P2 from #29283's review).

Why: the refusal hands the queued prompt back to the composer (harnessSwitch.fail), and a chat on another machine starts only with a send (run returns when startsOnSend and nothing is queued). The share's chat.harness.retry re-armed the switch with an empty queue, so it waited.

Fix: a share that went through retries, then sends the composer's prompt again, the same way Trust's answer already resends (trustAsk.refused(..., () => composerHandle.current?.send())). Retry after Ask the Owner does the same once the owner has shared; with no share yet it stays a plain retry. Without an onShared handler the card falls back to the old retry.

Tests: SwitchNotice.share.test.tsx checks that a share resends, that without a handler it falls back to a retry, that a recheck which finds the share resends, and that a recheck with no share is a plain retry.

Risk: low. Webview only, 4 files. It only runs after a successful share on the start-refusal card.

#29564 (the pane keeps ownerCloud: false after a share) is left for its own PR: whether a guest counts as owner is a separate decision.

Fixes #29563

šŸ¤– Generated with Claude Code

Agent session: agent session


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes Share with Me on a refused Cloud chat start, where after the share went through nothing happened until the person sent again (#29563).

The refusal hands the queued prompt back to the composer, and a chat on another machine starts only with a send, so the share now retries the start and resends the composed prompt, matching how Trust's answer already resends. Retry after Ask the Owner resends once the owner has shared; with no share yet it stays a plain retry. Without an onShared handler the card falls back to the old retry.

Tests cover the resend on share, the fallback without a handler, a recheck that finds the share and resends, and a plain retry when a recheck finds none.