mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 11:41:56 +03:00
Fix file open retry in ydocs server (#10787)
There is a code for exponential back off, but the result with error was lost at one place. Tested by mocking timeouts in our `lanugageServer.ts` Fixes #10606
This commit is contained in:
parent
0f5a3a78b1
commit
09c4b7a993
@ -396,7 +396,7 @@ class ModulePersistence extends ObservableV2<{ removed: () => void }> {
|
||||
return Ok()
|
||||
}
|
||||
case LsSyncState.Closed: {
|
||||
await this.withState(LsSyncState.Opening, async () => {
|
||||
return await this.withState(LsSyncState.Opening, async () => {
|
||||
const promise = this.ls.openTextFile(this.path)
|
||||
this.setLastAction(promise.then(res => !res.ok && this.setState(LsSyncState.Closed)))
|
||||
const result = await promise
|
||||
@ -409,7 +409,6 @@ class ModulePersistence extends ObservableV2<{ removed: () => void }> {
|
||||
this.syncFileContents(result.value.content, result.value.currentVersion)
|
||||
return Ok()
|
||||
})
|
||||
return Ok()
|
||||
}
|
||||
default: {
|
||||
assertNever(this.state)
|
||||
|
Loading…
Reference in New Issue
Block a user