fix: ignore Electron .asar archives in the FSAL and watcher - #6568
Open
costajohnt wants to merge 1 commit into
Open
costajohnt wants to merge 1 commit into
costajohnt wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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.
not use an LLM to draft this description.
the additional information section.