Skip to content

fix(apps): skip symbolic links outside the source folder when zipping sources - #258

Merged
robingenz merged 3 commits into
mainfrom
fix/zip-symlinks
Oct 26, 2026
Merged

robingenz merged 3 commits into
mainfrom
fix/zip-symlinks

Conversation

@robingenz

Copy link
Copy Markdown
Member

Symbolic links that point outside the project folder are no longer included in build source archives, matching live update bundles.
Links that stay inside the folder still work.
Added a unit test with a file link and a folder link that point outside the source folder.

🤖 Generated with Claude Code

robingenz and others added 2 commits October 26, 2026 13:59
… sources

Symbolic links that point outside the project folder are no longer included in build source archives, matching live update bundles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 26, 2026 16:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The containment check mishandles filesystem roots, and excluded files still count toward the ZIP-entry limit.

2 open issues
What changed in this PR

This PR updates build-source archiving to exclude symbolic links whose targets are outside the project folder, matching live update bundle behavior.

Changes:

  • Adds resolved-path checks before including files in source archives.
  • Adds a regression test covering external file and directory links.
File Description
src/​utils/​zip.ts Filters files whose resolved paths fall outside the source folder.
src/​utils/​zip.test.ts Tests exclusion of external symbolic links while retaining a project file.

Review effort: Balanced

Comment thread src/utils/zip.ts Outdated
Comment on lines +78 to +80
if (isOutsideFolder(filePath, realSourceFolder)) {
continue;
}
Comment thread src/utils/zip.ts
// so that `addLocalFile` reports it as a vanished file.
const isOutsideFolder = (filePath: string, realFolder: string): boolean => {
try {
return !fs.realpathSync(filePath).startsWith(realFolder + path.sep);
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robingenz
robingenz merged commit 46587c2 into main Oct 26, 2026
3 checks passed
@robingenz
robingenz deleted the fix/zip-symlinks branch October 26, 2026 16:44
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.

2 participants