Skip to content

Fix unhandled rejection when Linking.openURL fails for embed URLs#129

Open
gumclaw wants to merge 1 commit intomainfrom
fix/linking-open-url-unhandled-rejection
Open

Fix unhandled rejection when Linking.openURL fails for embed URLs#129
gumclaw wants to merge 1 commit intomainfrom
fix/linking-open-url-unhandled-rejection

Conversation

@gumclaw
Copy link
Copy Markdown

@gumclaw gumclaw commented Mar 30, 2026

Summary

  • Adds .catch() fallback on Linking.openURL() calls in app/purchase/[token].tsx and app/post/[id].tsx
  • When Linking.openURL fails (e.g. for iframely embed URLs that can't be opened as native deep links), falls back to WebBrowser.openBrowserAsync() to open the URL in an in-app browser
  • Fixes Sentry issue: unhandled promise rejection on iOS when WebView navigates to cdn.iframe.ly embed URLs

Test plan

  • TypeScript compiles cleanly
  • All 89 existing tests pass
  • Open a purchase page with an embedded YouTube video, tap the embed, verify it opens in the in-app browser instead of crashing
  • Verify normal external links (non-embed) still open correctly via Linking.openURL
  • Verify creator profile and CTA links on post pages still work

🤖 Generated with Claude Code

When WebView content contains iframely embeds (e.g. YouTube), the
navigation intercept calls Linking.openURL which throws if the system
can't open the URL as a native deep link. Add .catch() fallback to
open such URLs in an in-app browser via expo-web-browser instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants