fix(e2e): make pastebin share helpers resilient to async clipboard writes#441
Merged
Conversation
…ites getShareLinkHref/getAnchorHref in support/pages/pastebinPage.ts read the clipboard immediately after clicking the copy button. The app uses @vueuse/core useClipboard() to perform the actual write, and other flows (e.g. password-link creation) may have left a stale "URL\nPassword: ..." value in the clipboard. As a result, the helpers occasionally returned a stale value (e.g. the same alpha link for both alpha and beta). This is a latent race that became reliably reproducible once @vueuse/core was bumped from 14.2.1 to 14.3.0 (the "useClipboard: Prevents fail in Safari for async operation" change shifted the write to be more asynchronous in Chromium too), which is why the `public links` tests started failing on PR #439. Clear the clipboard before clicking and poll until the click handler has written a new non-empty value.
a64d2bd to
a9389fe
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a flaky e2e test caused by stale clipboard values when reading share links. The pastebin page helpers now clear the clipboard before clicking and poll until the async useClipboard write completes.
Changes:
- Added private
clickAndReadClipboardhelper that clears the clipboard, performs the click, then polls until a non-empty value appears (5s timeout). - Refactored
getShareLinkHrefandgetAnchorHrefto use this helper.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
JammingBen
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
getShareLinkHref/getAnchorHref in support/pages/pastebinPage.ts read the clipboard immediately after clicking the copy button. The app uses @vueuse/core useClipboard() to perform the actual write, and other flows (e.g. password-link creation) may have left a stale "URL\nPassword: ..." value in the clipboard. As a result, the helpers occasionally returned a stale value (e.g. the same alpha link for both alpha and beta).
This is a latent race that became reliably reproducible once @vueuse/core was bumped from 14.2.1 to 14.3.0 (the "useClipboard: Prevents fail in Safari for async operation" change shifted the write to be more asynchronous in Chromium too), which is why the
public linkstests started failing on PR #439.Clear the clipboard before clicking and poll until the click handler has written a new non-empty value.
Related Issue
How Has This Been Tested?
Types of changes