Skip to content

fix: return numeric blksize and blocks from asar fs.stat#50876

Merged
codebytere merged 1 commit into
41-x-yfrom
trop/41-x-y-bp-fix-return-numeric-blksize-and-blocks-from-asar-fs-stat-1775809159068
Apr 10, 2026
Merged

fix: return numeric blksize and blocks from asar fs.stat#50876
codebytere merged 1 commit into
41-x-yfrom
trop/41-x-y-bp-fix-return-numeric-blksize-and-blocks-from-asar-fs-stat-1775809159068

Conversation

@trop
Copy link
Copy Markdown
Contributor

@trop trop Bot commented Apr 10, 2026

Backport of #50825

See that PR for details.

Notes: Fixed fs.stat on files inside asar archives returning undefined for blksize and blocks instead of numeric values.

Previously, `fs.stat` on files inside `.asar` archives returned
`undefined` for `blksize` and `blocks`, violating the Node.js API
contract where these fields must be `number | bigint`.

Use `4096` for `blksize` (matching the convention used by `memfs` and
the proposed `node:vfs` module in nodejs/node#61478) and compute
`blocks` as `ceil(size / 512)` (standard 512-byte block units).

Fixes #42686

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Co-authored-by: clavin <clavin@electronjs.org>
@trop trop Bot requested review from a team and clavin April 10, 2026 08:19
@trop trop Bot added 41-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Apr 10, 2026
@codebytere codebytere merged commit 8720df9 into 41-x-y Apr 10, 2026
69 of 71 checks passed
@codebytere codebytere deleted the trop/41-x-y-bp-fix-return-numeric-blksize-and-blocks-from-asar-fs-stat-1775809159068 branch April 10, 2026 10:15
@release-clerk
Copy link
Copy Markdown

release-clerk Bot commented Apr 10, 2026

Release Notes Persisted

Fixed fs.stat on files inside asar archives returning undefined for blksize and blocks instead of numeric values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

41-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant