Skip to content

fix(desktop): retry transient clipboard image writes - #2189

Closed
Alx8g wants to merge 4 commits into
CapSoftware:mainfrom
Alx8g:fix/retry-clipboard-image-writes
Closed

Alx8g wants to merge 4 commits into
CapSoftware:mainfrom
Alx8g:fix/retry-clipboard-image-writes

Conversation

@Alx8g

@Alx8g Alx8g commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Transient clipboard contention no longer drops an otherwise successful screenshot automation.

The desktop host now retries failed image clipboard writes with a short, bounded exponential backoff. Raw files and rendered project outputs share the same path. Project rendering happens once; each attempt only rebuilds clipboard image data. The clipboard lock is released before waiting, so unrelated operations are not held behind the backoff.

This follows a transient Windows clipboard ownership failure observed in production, where an immediate retry succeeded. A focused test covers the retry bounds, and the existing source-selection tests remain unchanged.

Rust formatting and diff checks pass. Local Cargo tests did not start because Git Bash exited the Visual Studio environment wrapper before Cargo; upstream CI is the compile and test gate. No native clipboard acceptance run was performed for this branch.

RetriggerConfidence Score: 5/5

The reviewed changes appear safe to merge, with no actionable defect found.

Summary

Screenshot automation now retries failed clipboard image writes up to four times.

  • Desktop automation retries clipboard image writes after brief failures.

The previous and current commits have different merge bases, so this review used the full PR diff. Previous review threads were not supplied and could not be retrieved. No Cargo tests or native clipboard checks were run during this review.

Reviews (2) · Last reviewed commit: "Merge branch 'main' into fix/retry-clipb..." · Reviewed by Greptile

@superagent-security

Copy link
Copy Markdown

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@richiemcilroy

Copy link
Copy Markdown
Member

hey @greptileai, please re-review the PR

@richiemcilroy

Copy link
Copy Markdown
Member

Thanks so much for this contribution, @Alx8g! Cap's desktop app has now fully moved from Tauri to our new native GPUI app (apps/desktop-gpui), which ships as Cap from 0.6.1 on macOS, Windows and Linux. This PR only changes the old Tauri app (apps/desktop), so it no longer affects what we ship, and I'm closing it. If the change still makes sense for the GPUI app, we'd love a PR against apps/desktop-gpui. Really appreciate the time you put into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants