镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

vfs: promises.watch() resolves { done: true } instead of rejecting with a pre-aborted signal #66253

Description

@trivikr

Version

main

Platform

All

Subsystem

vfs

What steps will reproduce the bug?

import { create } from 'node:vfs';

const myVfs = create();
myVfs.writeFileSync('/p.txt', 'a');

const iter = myVfs.promises.watch('/p.txt', {
  signal: AbortSignal.abort()
});
iter.next().then(
  (r) => console.log('resolved:', r),
  (e) => console.log('rejected:', e.code),
);

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

.next() rejects with AbortError (code: 'ABORT_ERR'), matching native fs.promises.watch(dir, { signal: AbortSignal.abort() }).next(), which rejects with ABORT_ERR.

What do you see instead?

resolved: { done: true, value: undefined }

The iterator silently completes.

Additional information

No response

Activity

  1. self-assigned this
    on Sep 24, 2026
  2. added
    vfsIssues and PRs related to the virtual filesystem subsystem.
    on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

vfsIssues and PRs related to the virtual filesystem subsystem.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions