Conversation
|
🚅 Deployed to the rivet-pr-4978 environment in rivet-frontend
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Code ReviewOverviewThis PR fixes a production crash where accessing The fix is a one-line change — Core Fix (native.ts)The change is correct and minimal. The semantic mismatch is real: One side-effect worth acknowledging: Test Fixture (sleep.ts)The fixture is clean and the timing constants are well-named. A few notes: Missing positive assertion on Fragile output-string assertions. Checking Fixed-time Wasm Runtime Parity
Summary
The fix is correct. The main asks before merging: (1) add |
…nt c.vars crash after grace deadline
6a984aa to
0499832
Compare

The onSleep handler defers runtime state cleanup while keepAwakeCount > 0, but websocket callback promises were registered via waitUntil which doesn't increment keepAwakeCount. After the grace deadline expired, onSleep cleared the NAPI runtime state while async websocket handlers were still running, causing TypeError when they accessed c.vars.
Switching #callHandler from waitUntil to keepAwake makes websocket callback promises visible to the existing deferred-cleanup guard.
Adds a driver test that reproduces the production crash.