fix(#1707): improve buildSessionId with crypto.getRandomValues fallback - #1711
fix(#1707): improve buildSessionId with crypto.getRandomValues fallback#1711anshul23102 wants to merge 1 commit into
Conversation
…lues fallback for stronger uniqueness Issue magic-peach#1707: buildSessionId() falls back to Date.now() + Math.random() when crypto.randomUUID is unavailable, causing weak uniqueness and file name collisions in concurrent exports. Solution: - Use crypto.randomUUID() when available (primary method) - Fall back to crypto.getRandomValues() for cryptographically secure 128-bit random bytes - Convert to hex string to ensure uniqueness across concurrent requests - Final fallback uses timestamp + enhanced random components if crypto unavailable This ensures session IDs are globally unique even in high-concurrency scenarios where Date.now() has insufficient precision (only 1000 values per second). Fixes magic-peach#1707
|
@anshul23102 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. |
👋 Thanks for your PR, @anshul23102!Welcome to Reframe — a browser-based video editor built for everyone 🎬
What happens next
Quick checklist
Useful links
Happy coding! 🎉 |
✅ PR Format Check Passed — @anshul23102Basic format checks passed. A maintainer will review your code changes. This does not mean the PR is approved — it just means the format is correct. |
|
Hi @magic-peach team! 👋 I've completed the fix for Issue #1707 (buildSessionId weak uniqueness causing file name collisions in concurrent exports). What's Included✅ Cryptographically secure session ID generation For ReviewWhen reviewing, you might consider these labels that are especially valuable for GSSoC 2026 visibility:
Ready for your review! 🚀 Contributed as part of GSSoC 2026 |
Summary
Improve session ID generation to eliminate file name collisions in concurrent video exports by using cryptographically secure random generation.
Problem (Issue #1707)
The buildSessionId() function falls back to Date.now() + Math.random() when crypto.randomUUID is unavailable, causing:
Solution
Three-tier fallback approach:
Guarantees global uniqueness even in high-concurrency scenarios.
Changes
Testing
Fixes #1707
GSSoC 2026 Contribution