Skip to content

fix(runframe): recover polling error on reconnect and keep newest events (fixes tscircuit/tscircuit#5368) - #5891

Open
duongynhi000005-oss wants to merge 2 commits into
tscircuit:mainfrom
duongynhi000005-oss:fix-dev-server-restart-recovery
Open

duongynhi000005-oss wants to merge 2 commits into
tscircuit:mainfrom
duongynhi000005-oss:fix-dev-server-restart-recovery

Conversation

@duongynhi000005-oss

Copy link
Copy Markdown

Summary

  • In lib/components/RunFrameWithApi/store.ts, clear state.error when polling getEvents succeeds after a previous network/server failure.
    • Previously, after a dev server restart or temporary disconnection, error was set but never reset to null on subsequent successful polls, causing the UI ApiStatusIndicator to be stuck indefinitely displaying red "Dev server disconnected".
  • In store.ts, change recentEvents queue slicing to .slice(-100) instead of .slice(0, 100).
    • Previously, once recentEvents reached 100 events, .slice(0, 100) kept the oldest 100 events and discarded all newly arrived events.
  • In lib/components/RunFrameWithApi/api-base.ts, make window.TSCIRCUIT_FILESERVER_API_BASE_URL access safe in SSR/Node/Bun test environments with typeof window !== "undefined".
  • Adds unit tests in tests/runframe-api-polling-recovery.test.ts verifying error state recovery and newest event retention.

Fixes tscircuit/tscircuit#5368

/claim tscircuit/tscircuit#5368

@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
runframe Ready Ready Preview Oct 26, 2026 4:22am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

@duongynhi000005-oss

Copy link
Copy Markdown
Author

Keeping active for review. Clean CI passing and ready for merge.

@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

This branch was successfully deployed

1 active deployment
Preview — b9bb62aa Deployed Oct 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tsci dev UI doesn't recover after dev-server restart

1 participant