Skip to content

Fix btoa emoji crash#1485

Open
divyansha12 wants to merge 2 commits into
magic-peach:mainfrom
divyansha12:fix-btoa-emoji-crash
Open

Fix btoa emoji crash#1485
divyansha12 wants to merge 2 commits into
magic-peach:mainfrom
divyansha12:fix-btoa-emoji-crash

Conversation

@divyansha12

@divyansha12 divyansha12 commented Jun 1, 2026

Copy link
Copy Markdown

Hey @magic-peach

Description

Fixes a fatal DOMException crash when clicking "Copy Link" after adding a text overlay
containing emojis or non-ASCII characters. The native btoa() only accepts Latin1 characters,
so emoji in the JSON string caused an immediate unhandled exception with no user feedback.

Fix: Wraps JSON.stringify(recipe) with encodeURIComponent + unescape before
btoa(), and decodes symmetrically with escape + decodeURIComponent after atob().
Exports encodeRecipe from useVideoEditor.ts and uses it in VideoEditor.tsx's
handleCopyLink, replacing the crashing direct btoa() call.

Related Issue

Closes #1469

Type of Contribution

  • Bug fix
  • GSSoC contribution

Participant Info

  • GitHub username: divyansha12
  • Contribution level: Intermediate

Checklist

  • I have read the contribution guidelines
  • My changes follow the project structure
  • No console.log statements left in
  • This PR is related to a valid issue

@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

@divyansha12 is attempting to deploy a commit to the magic-peach1's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added level:beginner Beginner level - 20 pts type:bug Bug fix labels Jun 1, 2026
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ PR Format Issues — @divyansha12

Please fix the following before your PR can be reviewed:

  • ⚠️ Use a conventional PR title. Examples:
    • feat: add dark mode support
    • fix: resolve aria label missing on slider
    • docs: add deployment guide to README

Push new commits after fixing — this comment will update automatically.

📖 CONTRIBUTING.md

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

👋 Thanks for your PR, @divyansha12!

Welcome to Reframe — a browser-based video editor built for everyone 🎬

🟠 GSSoC'26 PR detected — thanks for contributing under GirlScript Summer of Code 2026!

What happens next

  1. 🤖 Automated checks — build & TypeScript typecheck will run automatically
  2. Vercel preview — a preview deployment will be created (requires maintainer authorization for fork PRs)
  3. 👀 Code review — a maintainer will review your changes
  4. 🚀 Merge — once approved, your PR will be merged!

Quick checklist

  • PR title follows Conventional Commits (e.g. feat: add dark mode)
  • Linked the issue this PR closes (e.g. Closes #123)
  • Tested the changes locally (bun run dev)
  • Build passes (bun run build)

Useful links

Happy coding! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc'26 GirlScript Summer of Code 2026 level:beginner Beginner level - 20 pts type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Application crashes on "Copy Link" when Text Overlay contains emojis or non-ASCII characters

1 participant