Skip to content

Fix Browserless.io Concurrency and Target Closed Errors#20

Draft
TimChinye wants to merge 1 commit intomasterfrom
fix/browserless-concurrency-limits-final-17103732769609120464
Draft

Fix Browserless.io Concurrency and Target Closed Errors#20
TimChinye wants to merge 1 commit intomasterfrom
fix/browserless-concurrency-limits-final-17103732769609120464

Conversation

@TimChinye
Copy link
Owner

This PR addresses the stability and rendering issues with the theme-wipe animation system when using Browserless.io.

Key improvements:

  1. Batched Snapshot Processing: Consolidates original and target theme snapshots into a single POST request to stay within the 2-concurrency limit of the Browserless.io plan. Inside the API, tasks are processed simultaneously using Promise.all within a single persistent connection to ensure visual state parity (e.g., synchronized marquee positions).
  2. Connection Persistence: Leverages a single shared browser instance correctly, removing redundant connection/disconnection logic that was causing 'Target closed' and 'detached frame' errors.
  3. API Readiness Tracking: The ThemeSwitcher now tracks the API warmup status and prevents theme toggling until the browser is ready, providing a smoother UX.
  4. Developer Debug Suite: Re-implemented the floating debug panel (bottom-right) to allow manual disabling of Puppeteer or modern-screenshot methods and added on-screen status text to verify fallbacks during transitions.
  5. Visual Fidelity: Reverted the DOM serialization logic to the original simple cloning method which was confirmed as 'visually perfect' by the user.

These changes eliminate the 429 errors while maintaining the high-quality animation experience.


PR created automatically by Jules for task 17103732769609120464 started by @TimChinye

…snapshots

- Refactored Snapshot API to accept multiple tasks in one request.
- Implemented simultaneous processing using Promise.all on a single persistent connection.
- Updated useThemeWipe to send batched requests and track API warmup status.
- Added a Developer Debug UI at the bottom-right for manual fallback overrides.
- Restored original "visually perfect" DOM serialization and rendering settings.
- Fixed Puppeteer base64 conversion TypeScript error.
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel
Copy link
Contributor

vercel bot commented Mar 2, 2026

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

Project Deployment Actions Updated (UTC)
portfolio Ready Ready Preview, Comment Mar 2, 2026 3:11pm

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.

1 participant