-
Notifications
You must be signed in to change notification settings - Fork 365
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
feat: [M3-8722] - Improve weblish retry behavior #11067
feat: [M3-8722] - Improve weblish retry behavior #11067
Conversation
* automatically reconnect weblish sessions that have disconnected * … unless it fails rapidly (more than 3 times in a 1 minute window) * … in which case show an error screen with as much information as we can provide * … where the error screen includes a button to try again. * focus the terminal element when starting (which is generally helpful but also prevents _losing_ focus after a reconnect) Previously, a failure would often just result in a spinning circle forever.
Coverage Report: ❌ |
…Error`. Break the `formatError` logic into two separate function that compute the two parts of the output, and then the main function just appends them. Adopt the preferred `const x = () =>` syntax in lieu of `function x()` syntax.
…s as its own, separate interface.
…iable as suggested in code review.
…d of `class` for `RetryLimiter`.
* Remove comments for obvious fields * `actionButton` => `actionButtonProps` * Combine `try` cases when parsing errors
* Add spaces around `=>` types. * Remove unnecessary `Optional Action Button` comment. * Refactor error handling using new `ParsePotentialLishErrorString` and `LishErrorInterface`. This centralizes all of the code to check structure and type of errors in one place. This may also prove using for future improvements to graphical lish. * Flatten websocket `close` handler logic from if-if-else-else structure to if-return-if-return-return.
* Remove second error format: It turns out that it will not be too difficult to make all of the errors follow the same basic format, so we don't need two separate parsers. Yay!
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.
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.
✅ confirmed reconnection x3
✅ confirmed error message after with Retry button
- repeated this a bunch of times and confirmed it was consistent 🎉
We'll also want to include a changeset for this
|
||
let parsed = null; | ||
try { | ||
parsed = JSON.parse(s); |
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.
any chance we know what the type/shape of parsed is, instead of using any?
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.
Until we do the checks following the quoted code, we don't know whether the incoming string actually conforms to the expected shape yet. The whole purpose of this function is to check the shape, and then if it is indeed in the expected shape, return the information that is useful to the code handling retries and errors. If we added an explicit type, it would just be used to cast away the "any" type once the shape is confirmed, then the code would immediately extract a few fields, and then discard that type. I don't think the additional overhead would add to the clarity or safety of the code.
Cloud Manager E2E Run #6723
Run Properties:
|
Project |
Cloud Manager E2E
|
Branch Review |
develop
|
Run status |
Passed #6723
|
Run duration | 25m 04s |
Commit |
941f30fe85: feat: [M3-8722] - Improve weblish retry behavior (#11067)
|
Committer | plisiecki1 |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
2
|
Skipped |
0
|
Passing |
438
|
View all changes introduced in this branch ↗︎ |
Description 📝
Previously, a failure would often just result in a spinning circle forever.
Changes 🔄
List any change relevant to the reviewer.
Lish.tsx
which may also be useful for similar enhancements to graphical lish (glish) in the future.socket
to be mutable and nullable so it can be updated when reconnecting.origSocket
local variable is used to ensure that “stale” events are properly ignored.close
handler, which also eliminates the potential for console output that too closely matches an "expired" error being interpreted as an error and breaking the session immediately.Target release date 🗓️
TBD.
Preview 📷
How to test 🧪
Prerequisites
Running linode(s).
Reproduction steps
Launch a lish session for a machine, type
^a d kill <enter>
. The session will exit and show a spinning circle.Verification steps
^a d kill <enter>
. The session will reconnect.As an Author I have considered 🤔
Check all that apply