Skip to content
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

Searching for extensions while network disconnected crashes onivim2 #2484

Closed
ninjabreakbot opened this issue Sep 19, 2020 · 2 comments · Fixed by #2552
Closed

Searching for extensions while network disconnected crashes onivim2 #2484

ninjabreakbot opened this issue Sep 19, 2020 · 2 comments · Fixed by #2552
Labels
A-extension Area: Extension/plugin integration, vscode or VimL bug Something isn't working I-crash It crashes. Is very bad! I-daily-editor-blocker An issue blocking use of the editor as a day-to-day editor

Comments

@ninjabreakbot
Copy link

MacOS:

  • 10.15.6

Onivim2:

  • 0.5.1 nightly

Steps:

  • With wifi disconnected from network or turned off
  • Launch Onivim2 (can already be launched before or after the disconnect)
  • Change to extensions page with mouse and click in search field
  • search "go" and press return key
  • Onivim2 crashes every time I attempt this.
@bryphe bryphe added A-extension Area: Extension/plugin integration, vscode or VimL bug Something isn't working I-daily-editor-blocker An issue blocking use of the editor as a day-to-day editor I-crash It crashes. Is very bad! labels Sep 22, 2020
@caleywoods
Copy link
Contributor

Related to #2334 it seems like

@Kampouse
Copy link

Kampouse commented Oct 4, 2020

i traced the error ->
` +11ms Revery.UI.Render : END: Render frame
[ERROR] +3ms Oni2.Core.NodeTask : events.js:292
throw er; // Unhandled 'error' event
^

Error: getaddrinfo EAI_AGAIN open-vsx.org
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26)
Emitted 'error' event on ClientRequest instance at:
at TLSSocket.socketErrorListener (_http_client.js:426:9)
at TLSSocket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'EAI_AGAIN',
code: 'EAI_AGAIN',
syscall: 'getaddrinfo',
hostname: 'open-vsx.org'
}
`

bryphe added a commit that referenced this issue Oct 6, 2020
…2552)

__Issue:__ When searching for extensions without a network connection, the editor would crash with:

```
(Invalid_argument Lwt.wakeup_exn)
Raised at file "stdlib.ml", line 30, characters 20-45
Called from file "src/process.ml", line 107, characters 12-54
```

__Defect:__ There is a race condition here - we are waiting for `EOF` on `stdout` to return the promise - and claim success. However, in the error case, we'd get EOF on stdout, run `Lwt.wakeup` to complete the promise, and _then_ get a call that the process has exited - and we'd call `Lwt.wakeup_exn` on the same promise. This triggers an invalid argument exception - we're trying to complete and then fail the same promise.

__Fix:__ Wait until both the process has exited, and stdout has given the `EOF` - then we'll complete the promise. At that point, we know if the process was successful or failed, and we could do the appropriate action on the promise.  Added test cases to cover these scenarios.

In addition, while debugging this, I saw that parsing was failing frequently when querying `open-vsx` - our parsing code was making the assumption that an `icon` field was always available, when that's not the case. 

Finally, I also added an error message when the search query fails:

![image](https://user-images.githubusercontent.com/13532591/95226543-ec4ce400-07b1-11eb-929c-b7147dd1d181.png)

Fixes #2484 , and should fix #2545 as well (FYI @zbaylin - might help your changes to validate license key!)

And fixes #2334 - thanks @CrossR !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-extension Area: Extension/plugin integration, vscode or VimL bug Something isn't working I-crash It crashes. Is very bad! I-daily-editor-blocker An issue blocking use of the editor as a day-to-day editor
Projects
None yet
4 participants