fix(sdk): correct filesystem watch handle callback and timeout behavior#1480
fix(sdk): correct filesystem watch handle callback and timeout behavior#1480mishushakov wants to merge 1 commit into
Conversation
Fixes three filesystem watch handle bugs across the JS and Python SDKs: - JS WatchHandle now awaits async onEvent/onExit callbacks so a rejecting onEvent is routed to onExit and stops the watch instead of crashing Node with an unhandled rejection. onExit fires exactly once (no arg on a clean end, the error on failure) and a throwing onExit can no longer leak. - Sync Python WatchHandle.get_new_events()/stop() now send a request timeout (default 60s, overridable) and the authentication header, so the polling and stop RPCs can't hang forever or be sent unauthenticated on older envd. - Async Python AsyncWatchHandle now invokes on_exit on a clean stream end (None) and on stop(), in addition to on error, matching the JS SDK, and swallows errors raised by on_exit to avoid unretrieved task exceptions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
PR SummaryLow Risk Overview Sync Python Async Python Reviewed by Cursor Bugbot for commit c3930bc. Bugbot is set up for automated code reviews on this repo. Configure here. |
🦋 Changeset detectedLatest commit: c3930bc The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Package ArtifactsBuilt from ef5e0de. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-2.30.6-mishushakov-fix-watch-handle-on-exit.0.tgzCLI ( npm install ./e2b-cli-2.12.3-mishushakov-fix-watch-handle-on-exit.0.tgzPython SDK ( pip install ./e2b-2.29.5+mishushakov.fix.watch.handle.on.exit-py3-none-any.whl |
Fixes three filesystem watch-handle bugs across the JS and Python SDKs. JS
WatchHandlenow awaits asynconEvent/onExitcallbacks so a rejectingonEventis routed toonExitand stops the watch instead of crashing Node with an unhandled rejection —onExitfires exactly once (no argument on a clean end, the error on failure) and a throwingonExitcan no longer leak. Sync PythonWatchHandle.get_new_events()/stop()now send a request timeout (default 60s, overridable) and the authentication header, so the polling/stop RPCs can't hang the thread forever or be sent unauthenticated on older envd. Async PythonAsyncWatchHandlenow invokeson_exiton a clean stream end (None) and onstop()in addition to on error — matching the JS SDK — and swallows errors raised byon_exitto avoid unretrieved task exceptions. Added unit tests for all three paths and a changeset (patch fore2b+@e2b/python-sdk).Usage
🤖 Generated with Claude Code