fix: patch @filen/sync to support FreeBSD in isValidPath - #442
Open
readefries wants to merge 1 commit into
Open
Conversation
@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>
Open
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.
Problem
@filen/sync'sisValidPath()only recognizeswin32,darwin, andlinuxin itsprocess.platformswitch. Any other platform — including FreeBSD (process.platform === "freebsd") — falls through todefault: return false, rejecting every single path.Because a rejected path is treated as a normal
invalidPathskip rather than a hard error, sync silently does nothing on FreeBSD: every cycle logs as successful withdeltasCountalways0, 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 withreason: "invalidPath"regardless of content, while directfilen download/filen lsof the same files worked fine.Related: #425
Fix
This adds a
bun patchfor@filen/sync(following the existing pattern already used here for@jupiterpi/node-keyringand@parcel/watcher) that makesfreebsdfall through to the same branch aslinuxinisValidPath, 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/syncas FilenCloudDienste/filen-sync#66. This patch here is a stopgap sofilen-cliusers on FreeBSD get working sync immediately, without waiting on that PR's review/release cycle. Once a@filen/syncrelease containing the fix is picked up by this repo, this patch (and itspatchedDependenciesentry) can simply be dropped.