Description
Summary
The Compare page currently uses the Clipboard API to copy the generated comparison URL, but the implementation does not handle promise rejections or provide any fallback when the copy operation fails.
If clipboard access is denied, unavailable, or unsupported by the user's browser, the share action silently fails without notifying the user. As a result, users may incorrectly assume that the comparison URL has been copied successfully.
This impacts the reliability and usability of the share functionality across browsers and environments where Clipboard API support is restricted.
Technical Evidence
Affected File
app/compare/CompareClient.tsx
Affected Component
Affected Function
Steps to Reproduce
- Open the Compare page.
- Generate a comparison URL.
- Deny Clipboard permission (or use a browser/environment where Clipboard API is unavailable).
- Click the Share button.
- Observe that the copy operation fails silently.
Expected Behavior
- Clipboard API promise rejections should be handled gracefully.
- Users should receive feedback when copying fails.
- A fallback mechanism should be considered where supported.
Screenshots / Logs
Evidence
The current implementation invokes the Clipboard API:
navigator.clipboard.writeText(url).then(...)
According to the current implementation (app/compare/CompareClient.tsx:989), the returned promise does not include a rejection handler (.catch()) or any fallback mechanism.
If the Clipboard API operation fails, the failure is silently ignored and no feedback is provided to the user.
GitHub Username (If applicable)
No response
Environment
Chrome
Description
Summary
The Compare page currently uses the Clipboard API to copy the generated comparison URL, but the implementation does not handle promise rejections or provide any fallback when the copy operation fails.
If clipboard access is denied, unavailable, or unsupported by the user's browser, the share action silently fails without notifying the user. As a result, users may incorrectly assume that the comparison URL has been copied successfully.
This impacts the reliability and usability of the share functionality across browsers and environments where Clipboard API support is restricted.
Technical Evidence
Affected File
app/compare/CompareClient.tsxAffected Component
CompareClientAffected Function
handleShareBattle()Steps to Reproduce
Expected Behavior
Screenshots / Logs
Evidence
The current implementation invokes the Clipboard API:
According to the current implementation (
app/compare/CompareClient.tsx:989), the returned promise does not include a rejection handler (.catch()) or any fallback mechanism.If the Clipboard API operation fails, the failure is silently ignored and no feedback is provided to the user.
GitHub Username (If applicable)
No response
Environment
Chrome