-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Improve transition to/from "offline" state #12196
Improve transition to/from "offline" state #12196
Conversation
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.
This fixes the clearest manifestation of the problem, but I wonder if the fix is in the right place. See my comment on the changes to the monaco-editor-model
file.
@@ -90,6 +91,7 @@ export class MonacoEditorModel implements IResolvedTextEditorModel, TextEditorDo | |||
protected readonly resource: Resource, | |||
protected readonly m2p: MonacoToProtocolConverter, | |||
protected readonly p2m: ProtocolToMonacoConverter, | |||
protected readonly connectionStatusService: ConnectionStatusService, |
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.
This should get a 'breaking changes' mention.
this.toDispose.push(this.connectionStatusService.onStatusChange(() => { | ||
this.cancelSave(); | ||
this.cancelSync(); | ||
})); |
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 this is where the problem manifested itself, but I wonder if the the problem shouldn't be fixed in the FileResource
code, since that's where the saving happens, and it's the connection to the backend file system that breaks saving / loading new content?
I believe we can close the pull-request for the time being, and revisit as necessary. |
What it does
Fixes #12194 by adding a timeout to
ConnectionStatusService
'sping
service to make sure frontend is aware of network interruptions sooner if backend is hanging.Fixes #12195 by cancelling save/sync in
monaco-editor-model
whenConnectionStatusService
'sonStatusChanged
event fires preventing scheduled saves/syncs from never resolving when backend goes offlineThe
hang-backend
package and command will be removed before merging this PR.Breaking Changes
Modifies constructor args for
MonacoEditorModel
to pass inConnectionStatusService
How to test
To test #12194:
To test #12195:
Review checklist
Reminder for reviewers