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

fix: handle null/undefined options for fs.readdir #34764

Merged
merged 3 commits into from
Jan 10, 2023

Conversation

dsanders11
Copy link
Member

Description of Change

Fixes isaacs/node-graceful-fs#223 in Electron. I also have a PR on that repo to improve their behavior (which would also fix the issue), so I'm fixing it from all angles.

This moves fs.readdir slightly closer to the typings from Node, but there's still other issues (options could be a string). I plan on doing a more general improvement PR to fix up behavior in lib/asar/fs-wrapper.ts.

Checklist

Release Notes

Notes: Fixed an error when fs.readdir gets null for options

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jun 27, 2022
@dsanders11 dsanders11 marked this pull request as ready for review June 28, 2022 01:48
Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM w/ nit

lib/asar/fs-wrapper.ts Outdated Show resolved Hide resolved
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jul 5, 2022
@codebytere
Copy link
Member

Looks like webpack/webpack#10227 - we can probably fix this but yeah let's do it in another PR!

@ckerr ckerr added semver/patch backwards-compatible bug fixes backport/requested 🗳 target/19-x-y target/21-x-y PR should also be added to the "21-x-y" branch. labels Sep 16, 2022
@ckerr
Copy link
Member

ckerr commented Sep 16, 2022

@dsanders11 patch LGTM, but needs an update to resolve merge conflicts

@jkleinsc jkleinsc added the target/23-x-y PR should also be added to the "23-x-y" branch. label Nov 30, 2022
@codebytere codebytere merged commit 168726a into electron:main Jan 10, 2023
@release-clerk
Copy link

release-clerk bot commented Jan 10, 2023

Release Notes Persisted

Fixed an error when fs.readdir gets null for options

trop bot added a commit that referenced this pull request Jan 10, 2023
trop bot added a commit that referenced this pull request Jan 10, 2023
@trop
Copy link
Contributor

trop bot commented Jan 10, 2023

I have automatically backported this PR to "21-x-y", please check out #36846

@trop trop bot added in-flight/21-x-y and removed target/21-x-y PR should also be added to the "21-x-y" branch. labels Jan 10, 2023
@trop
Copy link
Contributor

trop bot commented Jan 10, 2023

I have automatically backported this PR to "20-x-y", please check out #36847

@trop
Copy link
Contributor

trop bot commented Jan 10, 2023

I have automatically backported this PR to "23-x-y", please check out #36848

@trop
Copy link
Contributor

trop bot commented Jan 10, 2023

I have automatically backported this PR to "22-x-y", please check out #36849

@trop trop bot added in-flight/23-x-y merged/22-x-y PR was merged to the "22-x-y" branch. and removed target/20-x-y target/23-x-y PR should also be added to the "23-x-y" branch. target/22-x-y PR should also be added to the "22-x-y" branch. labels Jan 10, 2023
codebytere pushed a commit that referenced this pull request Jan 11, 2023
fix: handle null/undefined options for fs.readdir (#34764)

Co-authored-by: David Sanders <[email protected]>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <[email protected]>
@trop trop bot removed the in-flight/22-x-y label Jan 11, 2023
codebytere pushed a commit that referenced this pull request Jan 11, 2023
fix: handle null/undefined options for fs.readdir (#34764)

Co-authored-by: David Sanders <[email protected]>

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <[email protected]>
@trop trop bot added merged/23-x-y PR was merged to the "23-x-y" branch. and removed in-flight/23-x-y labels Jan 11, 2023
@dsanders11 dsanders11 deleted the fs-wrapper-readdir branch January 12, 2023 18:34
dsanders11 added a commit that referenced this pull request Jan 19, 2023
@trop trop bot added merged/21-x-y PR was merged to the "21-x-y" branch. and removed in-flight/21-x-y labels Jan 23, 2023
zcbenz pushed a commit that referenced this pull request Jan 23, 2023
* fix: handle null/undefined options for fs.readdir (#34764)

Co-authored-by: David Sanders <[email protected]>

* chore: remove optional chaining

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <[email protected]>
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
gecko19 pushed a commit to brightsign/electron that referenced this pull request Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/21-x-y PR was merged to the "21-x-y" branch. merged/22-x-y PR was merged to the "22-x-y" branch. merged/23-x-y PR was merged to the "23-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incompatible with Electron v10.x.y+ when dealing with .asar
6 participants