Skip to content

docs(SmartLink): Handle clipboard write permission denied error#17854

Draft
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/docs-84p-clipboard-permission
Draft

docs(SmartLink): Handle clipboard write permission denied error#17854
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/docs-84p-clipboard-permission

Conversation

@sentry
Copy link
Copy Markdown
Contributor

@sentry sentry Bot commented May 21, 2026

DESCRIBE YOUR PR

*This PR addresses issue DOCS-84P, where a NotAllowedError was reported when navigator.clipboard.writeText() failed due to write permission being denied. This typically occurred in environments like Linux or headless Chrome, which accounted for a significant portion of the reported errors.

The SmartLink component, specifically in its handleAutolinkClick function, attempted to write the link.href to the clipboard when an autolink heading was clicked. This operation was not wrapped in a try/catch block, leading to unhandled exceptions when the browser denied clipboard write access.

To fix this, the navigator.clipboard.writeText() call has been wrapped in an async try/catch block. This ensures that NotAllowedError exceptions, which are expected behavior in environments where clipboard access is restricted, are silently caught and do not result in unhandled errors being reported to Sentry.*

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

LEGAL BOILERPLATE

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

EXTRA RESOURCES

Fixes DOCS-84P

@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Error Error May 21, 2026 6:40pm
sentry-docs Error Error May 21, 2026 6:40pm

Request Review

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.

0 participants