Skip to content

[BUG]: Unhandled Async Clipboard Promise in TransactionCard.tsx #130

@Atharva0506

Description

@Atharva0506

Bug Description

The handleCopyHash function in TransactionCard.tsx calls navigator.clipboard.writeText() without awaiting the returned Promise. This causes a false success toast to appear even when the clipboard write fails, and silently swallows any errors.

Expected Behavior

  • toast.success("Transaction hash copied!") should only fire after a confirmed successful write.
  • On failure, a toast.error(...) should be displayed.

Steps to Reproduce

  1. Open a transaction in the UI
  2. Click the Copy Hash button
  3. Simulate a clipboard failure (e.g. revoke clipboard permission in browser settings, or serve over HTTP)
  4. Observe that the success toast still appears despite the failure

Logs and Screenshots

N/A — Bug is reproducible via code inspection.

Environment Details

  • OS: Windows 11
  • Browser: Chrome

Impact

Low - Minor inconvenience

Code of Conduct

  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions