fix: respect 'bigint' option for lstat(Sync) for asar wrapper#47505
fix: respect 'bigint' option for lstat(Sync) for asar wrapper#47505panther7 wants to merge 1 commit intoelectron:mainfrom
Conversation
16cfd65 to
913540e
Compare
|
@codebytere done |
913540e to
d4e8640
Compare
|
Btw, why asar file returns always size "0"? Because, if i call native fs.lstat('app.asar', console.log)
> null Stats {
dev: 0,
mode: 33206,
nlink: 1,
uid: 0,
gid: 0,
rdev: 0,
blksize: 4096,
ino: 7881299348490233,
size: 132247133,
blocks: 258296,
atimeMs: 1750337668594.9424,
mtimeMs: 1750337664266.7073,
ctimeMs: 1750337664266.7073,
birthtimeMs: 1750337663840.4016
}
|
136e21b to
572b7ec
Compare
| } | ||
|
|
||
| return asarStatsToFsStats(stats); | ||
| return asarStatsToFsStats(stats, options); |
There was a problem hiding this comment.
Question is, why it not used native lstat for compute values, like:
| return asarStatsToFsStats(stats, options); | |
| return lstat(pathArgument, options, callback); |
There was a problem hiding this comment.
@MarshallOfSound i think you probably have the most context here
There was a problem hiding this comment.
Probably, hotfix:
if (stats.size === 0) {
stats.size = lstatSync(filePath, options).size;
}572b7ec to
16fd533
Compare
|
Any progress with this? |
|
@panther7 we're down a few maintainers due to illness at the moment. Please be patient. This PR will be reviewed as bandwidth permits. |
16fd533 to
910fef9
Compare
910fef9 to
7616764
Compare
7616764 to
f698bae
Compare
|
Another month has out, can I help with it some progress? |
94a0dba to
84effcd
Compare
84effcd to
0813071
Compare
|
Next month out. |
0813071 to
400748b
Compare
478b3d8 to
c8ad46c
Compare
|
Three months of being ignoring. What can i do for move this PR to merge? |
c8ad46c to
5ea083d
Compare
7f8dd6a to
b5a6478
Compare
|
Ok, this can't works, becase return object must be a type |
@panther7 can you clarify what you mean here? Are you saying your currently proposed change won't work? |
|
Yes, it won't work because the Since The only option is to "cancel" fake |
ckerr
left a comment
There was a problem hiding this comment.
Marking as 'request changes' to prevent accidental merging, since #47505 (comment) says that the current version of this PR won't work.
|
I know, how fix it but I don't know, why maintaner use fake Stats for asar file. Maybe some @MarshallOfSound? |
|
@panther7 what does 'fake stats' mean here? i.e. what part of the code are you referring to? |
|
@ckerr electron/lib/node/asar-fs-wrapper.ts Line 131 in b5a6478 Using deprecated For resolve this issue is need Right solution is use native fs.stat method which return right object. But i don't know, why is used this fake |
68e7eb8 to
0626af3
Compare
|
This is probably fix 0626af3 with using native lstat... |
|
@panther7 just to make sure I'm understanding the PR correctly -- the other properties returned by |
|
Actually, The question is: why are Electron developers creating a fake My suggested solution is to use native If a fake Used |
0626af3 to
fb068de
Compare
fb068de to
7faa99b
Compare
Looks like that
|
|
Maybe @MarshallOfSound could tell about it. |
codebytere
left a comment
There was a problem hiding this comment.
This is fundamentally not feasible unfortunately. It's not possible to get native stats on asar files because the file doesn't exist to make the stat syscall on. That's why it's faked.
Description of Change
Fixed an issue where lstat option 'bigint' was ignored.
Issue discover via
get-folder-sizemodule. PRChecklist
npm testpassesRelease Notes
Notes: Fixed an issue where lstat option 'bigint' was ignored.