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

[Bug]: v29 fs module fails to recognize files containing emojis on Windows #41484

Closed
3 tasks done
brianpetro opened this issue Feb 29, 2024 · 10 comments
Closed
3 tasks done
Assignees
Labels
29-x-y bug 🪲 platform/windows status/confirmed A maintainer reproduced the bug or agreed with the feature

Comments

@brianpetro
Copy link

Preflight Checklist

Electron Version

29

What operating system are you using?

Windows

Operating System Version

10

What arch are you using?

x64

Last Known Working Electron version

28

Expected Behavior

fs.existsSync should return true for file paths containing emojis.

Actual Behavior

fs.readdirSync lists files with the emojis; however, calling fs.existsSync fails for the same files.

Testcase Gist URL

No response

Additional Information

No response

@VerteDinde VerteDinde added the blocked/need-repro Needs a test case to reproduce the bug label Mar 2, 2024
@electron-issue-triage
Copy link

Hello @brianpetro. Thanks for reporting this and helping to make Electron better!

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

Now adding the blocked/need-repro Needs a test case to reproduce the bug label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

@electron-issue-triage electron-issue-triage bot removed the blocked/need-repro Needs a test case to reproduce the bug label Mar 2, 2024
@Rn145
Copy link

Rn145 commented Mar 2, 2024

This is a problem of the fs module and encodings. Electron has nothing to do with it.

@brianpetro
Copy link
Author

@Rn145 are you sure about that?

Why would changing from electron 28 to electron 29 cause the issue, with the same node and presumably fs version?

@Rn145
Copy link

Rn145 commented Mar 3, 2024

I can't say anything about switching to another version of Electron. But on a simple script for Node.js (version 20.11.1) I have the same problem with emoticons.

const fs = require('fs');

const files = fs.readdirSync(".");
files.forEach((filename, i)=>{
	console.log(filename, fs.existsSync(filename));
});

If he does not accept the filenames that he returned, then this is at least strange.

However, it does work with the heart.
image

@Rn145
Copy link

Rn145 commented Mar 3, 2024

@brianpetro
I think this is the answer: nodejs/node#48673
they didn't fix it for the LTS version.

@brianpetro
Copy link
Author

@Rn145 thanks for your help in getting to the bottom of this.

What are the implications? Is this going to remain broken in Electron versions that use the affected node versions?

@VerteDinde
Copy link
Member

@Rn145 Thanks so much for hunting down the root cause in Node, very appreciated! 🙇‍♀️

@brianpetro Thanks for the original issue report - I'll see what the status is for getting this fixed in Node 20 LTS, in which case we can update to the fixed version. We could possibly cherry-pick or patch in the libuv fix if needed, we just try to avoid drift with upstream dependencies when we can. I'll check on this and report back.

@Prinzhorn
Copy link
Contributor

See #41673

@Prinzhorn
Copy link
Contributor

@codebytere the PR was merged, can this be closed as well?

@codebytere codebytere self-assigned this Mar 25, 2024
@codebytere
Copy link
Member

Closed in #41673

@codebytere codebytere removed the blocked/upstream ❌ Blocked on upstream; e.g. Chromium or Node label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
29-x-y bug 🪲 platform/windows status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects
No open projects
Status: 🛠️ Fixed for Next Release
Development

No branches or pull requests

5 participants