Skip to content

fix: ignore Electron .asar archives in the FSAL and watcher - #6568

Open
costajohnt wants to merge 1 commit into
Zettlr:developfrom
costajohnt:fix/6551-ignore-asar-archives
Open

costajohnt wants to merge 1 commit into
Zettlr:developfrom
costajohnt:fix/6551-ignore-asar-archives

Conversation

@costajohnt

@costajohnt costajohnt commented Sep 18, 2026 •

Copy link
Copy Markdown

Description

Zettlr crashes at startup if your workspace has a .asar file in it

Changes

added .asar to the list of paths Zettlr ignores, plus a test and a changelog line

Tested on

tested on Mac, ran the testing suite

Additional information

Closes #6551

AI Disclosure Statement

coding agent implemented the fix, i reviewed and tested myself

Declarations

  • I hereby confirm that I am solely responsible for the code provided in
    this PR. Usage of AI to generate code has been documented and made
    transparent. I understand that AI cannot be an author and the commit messages
    do not contain any chatbots or agents as "co-authors". There are no copyright
    issues with my code.
  • I hereby confirm that I wrote this PR description myself and that I did
    not use an LLM to draft this description.
  • I have specified any open issues that this PR fixes/closes accordingly in
    the additional information section.

Electron's built-in asar support patches Node's fs in the main process
so that an .asar archive looks like a directory to fs.stat/fs.lstat,
while fs.readdir on the parent still reports it as a file. The FSAL
mixes both views: readDirectoryRecursively pushes the archive as a file,
getDescriptorFor then treats it as a directory, FSALDir.parse fails on
the archive root, and the fallback file loader throws "Cannot load file
... as it is a directory". Nothing above reindexFiles catches this, so
the app exits on every boot once a workspace contains an .asar.

Add .asar to WATCHDOG_IGNORE_PATHS so neither the FSAL nor chokidar
ever hands such a path to the descriptor loader. Zettlr cannot do
anything useful with an asar anyway, and this keeps getDescriptorFor
throwing for genuinely invalid paths (see Zettlr#6223 / Zettlr#6225).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash on startup: Unhandled FSAL error when workspace contains an external .asar archive (Cannot load file ... as it is a directory)

1 participant