Skip to content

Adding retry logic while querying\fetching data from clipboard#14271

Open
Shyam-Gupta wants to merge 1 commit intodotnet:mainfrom
Shyam-Gupta:clipboard
Open

Adding retry logic while querying\fetching data from clipboard#14271
Shyam-Gupta wants to merge 1 commit intodotnet:mainfrom
Shyam-Gupta:clipboard

Conversation

@Shyam-Gupta
Copy link
Member

@Shyam-Gupta Shyam-Gupta commented Feb 5, 2026

Issue: Frequent copy/paste operations from clipboard can cause IDataObject.QueryGetData(...) and IDataObject.GetData(...) to fail with HResult = CLIPBRD_E_CANT_OPEN. It can happen if the clipboard is in locked state by another process when a second process is attempting to read data.

Fix: Retry logic around these calls with a small delay fixes the issue reliably.

@Shyam-Gupta Shyam-Gupta self-assigned this Feb 5, 2026
@github-actions github-actions bot added the area-Clipboard Issues related to Clipboard label Feb 5, 2026
@Shyam-Gupta Shyam-Gupta marked this pull request as ready for review February 5, 2026 01:17
@Shyam-Gupta Shyam-Gupta requested a review from a team as a code owner February 5, 2026 01:17
@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.19087%. Comparing base (9b546b7) to head (3eab5ca).

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #14271         +/-   ##
===================================================
+ Coverage   77.18395%   77.19087%   +0.00692%     
===================================================
  Files           3279        3280          +1     
  Lines         645138      645189         +51     
  Branches       47730       47733          +3     
===================================================
+ Hits          497943      498027         +84     
+ Misses        143503      143468         -35     
- Partials        3692        3694          +2     
Flag Coverage Δ
Debug 77.19087% <100.00000%> (+0.00692%) ⬆️
integration 18.99180% <35.08772%> (+0.00116%) ⬆️
production 52.08315% <100.00000%> (+0.01996%) ⬆️
test 97.40479% <ø> (ø)
unit 49.54702% <100.00000%> (+0.04440%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

area-Clipboard Issues related to Clipboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant