neovim / neovim/node-client

unreliable proc.on('close') event

Open
#419 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
537
Forks
57
Avg merge
1h 6m
Merged PRs (30d)
6

Description

This is a tracking issue for a potential issue noticed in https://github.com/neovim/node-client/pull/414#discussion_r1796637402

Problem

proc.on('close') does not always trigger on nvim.quit(). Based on the failures demonstrated in https://github.com/neovim/node-client/pull/418, it appears that sometimes the child (nvim) does not close the stderr pipe:

    expect(received).toStrictEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

      Object {
        "errors": 0,
    -   "stderrClosed": true,
    +   "stderrClosed": false,
        "stdoutClosed": true,
      }

      172 |     // TODO: 'close' event sometimes does not emit. #414
      173 |     proc.on('exit', () => {
    > 174 |       expect(r).toStrictEqual({
          |                 ^
      175 |         stdoutClosed: true,
      176 |         stderrClosed: true,
      177 |         errors: 0,

      at ChildProcess.toStrictEqual (src/attach/attach.test.ts:174:17)

Solution

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/attach/attach.test.ts around the failing proc.on('exit') assertion and review the linked discussions in pull requests 414 and 418. Determine whether the issue should be resolved through node-client documentation, a reliable event-handling change, or an Nvim fix; done means the stderr/close behavior is established and the relevant test or documentation reflects it.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
backend, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.