Skip to content

fix: patch @filen/sync to support FreeBSD in isValidPath - #442

Open
readefries wants to merge 1 commit into
FilenCloudDienste:mainfrom
readefries:fix/freebsd-sync-patch
Open

fix: patch @filen/sync to support FreeBSD in isValidPath#442
readefries wants to merge 1 commit into
FilenCloudDienste:mainfrom
readefries:fix/freebsd-sync-patch

Conversation

@readefries

Copy link
Copy Markdown

Problem

@filen/sync's isValidPath() only recognizes win32, darwin, and linux in its process.platform switch. Any other platform — including FreeBSD (process.platform === "freebsd") — falls through to default: return false, rejecting every single path.

Because a rejected path is treated as a normal invalidPath skip rather than a hard error, sync silently does nothing on FreeBSD: every cycle logs as successful with deltasCount always 0, and no files are ever transferred, with no visible error to the user.

Confirmed live on a FreeBSD 14 jail running filen-cli: every remote/local path was classified with reason: "invalidPath" regardless of content, while direct filen download/filen ls of the same files worked fine.

Related: #425

Fix

This adds a bun patch for @filen/sync (following the existing pattern already used here for @jupiterpi/node-keyring and @parcel/watcher) that makes freebsd fall through to the same branch as linux in isValidPath, since FreeBSD forbids the same single illegal character in filenames (NUL byte).

Relationship to the upstream fix

A proper fix with full unit/scenario test coverage has been submitted directly to @filen/sync as FilenCloudDienste/filen-sync#66. This patch here is a stopgap so filen-cli users on FreeBSD get working sync immediately, without waiting on that PR's review/release cycle. Once a @filen/sync release containing the fix is picked up by this repo, this patch (and its patchedDependencies entry) can simply be dropped.

@filen/sync's isValidPath() only recognizes win32, darwin and linux in
its process.platform switch; every other platform (including freebsd)
falls through to `default: return false`, rejecting every single path.
Since a rejected path is treated as an ordinary 'invalidPath' skip
rather than a hard error, this makes sync silently do nothing on
FreeBSD: every cycle logs as successful with zero deltas and no
files are ever transferred, with no visible error.

Confirmed live on a FreeBSD 14 jail: every remote/local path was
classified with reason 'invalidPath' regardless of content, while
direct filen download/ls of the same files worked fine.

This adds a bun patch (following the existing pattern used for
@jupiterpi/node-keyring and @parcel/watcher) that makes freebsd fall
through to the same branch as linux in isValidPath, since FreeBSD
forbids the same single illegal character in filenames (NUL).

A proper upstream fix with test coverage has been submitted as
FilenCloudDienste/filen-sync#66. This patch is a stopgap so filen-cli
users on FreeBSD get working sync immediately, without waiting on
that PR's review/release cycle; it can be dropped once a filen-sync
release containing the fix is picked up here.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Hendrik Bruinsma <hbruinsma@xs4some.nl>
@readefries readefries mentioned this pull request Jul 22, 2026
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.

1 participant