-
Notifications
You must be signed in to change notification settings - Fork 69
Backoff Reconnect #6358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backoff Reconnect #6358
Conversation
lee-at-zoo-corp
commented
Apr 16, 2025
•
edited
Loading
edited
- Backoff reconnect behavior added (Fibonacci sequence used due to nice time scaling properties)
- Translate WebSocket error numbers to text on the loading screen
- Detect disconnections and reconnect
- Restore camera state on reconnect even on sudden disconnects
- Add a RestartRequest event that the application can fire at any point to restart the engineConnection
- Add E2E stream pause test
- Lifted more logic from EngineStream into engineStreamMachine
- Added a slew of debug messages to network code startup
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
385d799
to
dd8b870
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6358 +/- ##
=======================================
Coverage 85.41% 85.41%
=======================================
Files 109 109
Lines 47482 47482
=======================================
Hits 40559 40559
Misses 6923 6923
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
feb295a
to
dbdbc8d
Compare
dbdbc8d
to
f01a092
Compare
bfec3c4
to
8fcf4f1
Compare
8fcf4f1
to
aa92c11
Compare
aa92c11
to
3dc4e0f
Compare
3dc4e0f
to
3afd31b
Compare
3afd31b
to
f54582f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright I parsed through it, I can't pretend that I understand it all but it all seems to make sense. I have one request to look at before merging: the use of the TEST env var, see comment at the top of EngineStream.tsx about using an existing helper.
Going to test locally now!
e2e/playwright/snapshot-tests.spec.ts-snapshots/theme-persists-1.png
Outdated
Show resolved
Hide resolved
// We should eventually only have 1 restoral call. | ||
if (this.idleMode) { | ||
await this.sceneInfra?.camControls.restoreRemoteCameraStateAndTriggerSync() | ||
} else { | ||
// NOTE: This code is old. It uses the old hack to restore camera. | ||
console.log('call default_camera_get_settings') | ||
// eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
await this.sendSceneCommand({ | ||
// CameraControls subscribes to default_camera_get_settings response events | ||
// firing this at connection ensure the camera's are synced initially | ||
type: 'modeling_cmd_req', | ||
cmd_id: uuidv4(), | ||
cmd: { | ||
type: 'default_camera_get_settings', | ||
}, | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The await
keyword is missing in the if (this.idleMode)
branch when calling this.sceneInfra?.camControls.restoreRemoteCameraStateAndTriggerSync()
. This could lead to timing issues since the function appears to be asynchronous. Both branches should consistently use await
to ensure proper sequencing of operations during camera restoration.
// Should be:
if (this.idleMode) {
await this.sceneInfra?.camControls.restoreRemoteCameraStateAndTriggerSync()
} else {
// ...
}
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow the first time it's wrong? Both branches clearly use await?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally on macOS and Windows. LGTM!
And thanks for the changes!