-
Notifications
You must be signed in to change notification settings - Fork 30.5k
fix: add missing null on file watch event filename #65505
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
Conversation
|
@sosoba Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PR
Code ReviewsBecause this is a widely-used package, a DT maintainer will need to review it before it can be merged. You can test the changes of this PR in the Playground. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 65505,
"author": "sosoba",
"headCommitOid": "4ab7de1a7a4446009929c06c038857dadb1beb45",
"mergeBaseOid": "d9244492f8e3e1cf1560185d8c02b4a75a18633b",
"lastPushDate": "2023-05-18T05:46:56.000Z",
"lastActivityDate": "2023-05-26T20:10:56.000Z",
"mergeOfferDate": "2023-05-25T18:00:42.000Z",
"mergeRequestDate": "2023-05-26T20:10:56.000Z",
"mergeRequestUser": "Semigradsky",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "node",
"kind": "edit",
"files": [
{
"path": "types/node/fs.d.ts",
"kind": "definition"
},
{
"path": "types/node/fs/promises.d.ts",
"kind": "definition"
},
{
"path": "types/node/ts4.8/fs.d.ts",
"kind": "definition"
},
{
"path": "types/node/ts4.8/fs/promises.d.ts",
"kind": "definition"
},
{
"path": "types/node/v16/fs.d.ts",
"kind": "definition"
},
{
"path": "types/node/v16/fs/promises.d.ts",
"kind": "definition"
},
{
"path": "types/node/v16/ts4.8/fs.d.ts",
"kind": "definition"
},
{
"path": "types/node/v16/ts4.8/fs/promises.d.ts",
"kind": "definition"
},
{
"path": "types/node/v18/fs.d.ts",
"kind": "definition"
},
{
"path": "types/node/v18/fs/promises.d.ts",
"kind": "definition"
},
{
"path": "types/node/v18/ts4.8/fs.d.ts",
"kind": "definition"
},
{
"path": "types/node/v18/ts4.8/fs/promises.d.ts",
"kind": "definition"
}
],
"owners": [
"Microsoft",
"DefinitelyTyped",
"jkomyno",
"alvis",
"r3nya",
"btoueg",
"smac89",
"touffy",
"DeividasBakanas",
"eyqs",
"Hannes-Magnusson-CK",
"hoo29",
"kjin",
"ajafff",
"islishude",
"mwiktorczyk",
"mohsen1",
"n-e",
"galkin",
"parambirs",
"eps1lon",
"SimonSchick",
"ThomasdenH",
"WilcoBakker",
"wwwy3y3",
"samuela",
"kuehlein",
"bhongy",
"chyzwar",
"trivikr",
"yoursunny",
"qwelias",
"ExE-Boss",
"peterblazejewicz",
"addaleax",
"victorperin",
"ZYSzys",
"NodeJS",
"LinusU",
"wafuwafu13",
"mcollina",
"Semigradsky"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "mcollina",
"date": "2023-05-26T14:42:32.000Z",
"isMaintainer": false
},
{
"type": "approved",
"reviewer": "jakebailey",
"date": "2023-05-25T17:59:59.000Z",
"isMaintainer": true
},
{
"type": "approved",
"reviewer": "Semigradsky",
"date": "2023-05-18T08:18:03.000Z",
"isMaintainer": false
}
],
"mainBotCommentID": 1548940598,
"ciResult": "pass"
} |
|
Hey @sosoba, 😒 Your PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Please consider adding tests to cover the change you're making. Including tests allows this PR to be merged by yourself and the owners of this module. This can potentially save days of time for you! |
|
🔔 @microsoft @DefinitelyTyped @jkomyno @alvis @r3nya @btoueg @smac89 @Touffy @DeividasBakanas @eyqs @Hannes-Magnusson-CK @hoo29 @kjin @ajafff @islishude @mwiktorczyk @mohsen1 @n-e @galkin @parambirs @eps1lon @SimonSchick @ThomasdenH @WilcoBakker @wwwy3y3 @samuela @kuehlein @bhongy @chyzwar @trivikr @yoursunny @qwelias @ExE-Boss @peterblazejewicz @addaleax @victorperin @ZYSzys @nodejs @LinusU @wafuwafu13 @mcollina @Semigradsky — please review this PR in the next few days. Be sure to explicitly select |
|
@sosoda It looks like |
All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`
You have right!. Doc says:
I added a second change. |
|
Related: nodejs/node#48032 |
|
what's the outcome here? Do we need TS4.8 update and ship? |
|
Sure! @sosoba please, add these changes also to another applicable node versions (v14, v16, v18 folders) and to TypeScript<4.8 versions (ts4.8 folders). |
Semigradsky
left a comment
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.
👍
|
I feel like I'm missing something in the docs; the link provided in the PR description doesn't seem to go anywhere. Everything I'm reading seems to imply that this filename is not nullable: https://nodejs.org/dist/latest-v18.x/docs/api/fs.html#event-change |
|
Ugh, it was my browser. This section appears in the
This is going to be pretty breaky :\ |
|
I know that this is probably technically correct, but is it super useful if all of the major OSs definitely get a string every time? |
What you mean "major OS"? I have issue with empty filename for Windows 11. This happens ex. when Node watch which files are modified by another Java process. |
|
I guess the wording doesn't preclude a "supported" OS passing null... |
|
⏳ Hi @sosoba, It's been a few days since this PR was approved by Semigradsky and we're waiting for a DT maintainer to give a review. If you would like to short-circuit this wait, you can edit some of the test files in the package which verify how the |
jakebailey
left a comment
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.
I guess we'll see; I know TS itself will have to fix a type error with this.
|
@sosoba: Everything looks good here. I am ready to merge this PR (at 4ab7de1) on your behalf whenever you think it's ready. If you'd like that to happen, please post a comment saying:
and I'll merge this PR almost instantly. Thanks for helping out! ❤️ (@microsoft, @DefinitelyTyped, @jkomyno, @alvis, @r3nya, @btoueg, @smac89, @Touffy, @DeividasBakanas, @eyqs, @Hannes-Magnusson-CK, @hoo29, @kjin, @ajafff, @islishude, @mwiktorczyk, @mohsen1, @n-e, @galkin, @parambirs, @eps1lon, @SimonSchick, @ThomasdenH, @WilcoBakker, @wwwy3y3, @samuela, @kuehlein, @bhongy, @chyzwar, @trivikr, @yoursunny, @qwelias, @ExE-Boss, @peterblazejewicz, @addaleax, @victorperin, @ZYSzys, @nodejs, @LinusU, @wafuwafu13, @mcollina, @Semigradsky: you can do this too.) |
mcollina
left a comment
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.
lgtm
|
Ready to merge |
…event filename by @sosoba * fix: add missing null on watch event filename * fix: add missing null on fsPromises.watch result filename All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()` * fix: applly fs.watch to another node versions
Fixed the type of `fs.watch`, which may pass to `null` for the callback (DefinitelyTyped/DefinitelyTyped#65505). Removed `WritableStream` type, since its events don't match `busboy` anymore (DefinitelyTyped/DefinitelyTyped#68313).
Please fill in this template.
npm test <package to test>.If changing an existing definition: