Skip to content

feat(cloudsync): add a local folder sync provider - #241

Open
loooinfo wants to merge 1 commit into
TooonyChen:mainfrom
loooinfo:feature/local-folder-sync
Open

loooinfo wants to merge 1 commit into
TooonyChen:mainfrom
loooinfo:feature/local-folder-sync

Conversation

@loooinfo

@loooinfo loooinfo commented Nov 23, 2026 •

Copy link
Copy Markdown

Summary

Users who already synchronize folders with another tool can select Local folder in Options › Sync. Finallyshell reads and writes the existing encrypted finallyshell-sync.json; each computer chooses its own directory and uses the same sync password. The entire provider configuration remains local, following the Gist, WebDAV and S3 rules.

The provider implements the existing Remote interface with content-hash versions, OS file locks in the local user cache and temporary-file replacement. Absolute directory identities reset the merge base when the destination changes. Existing merge, automatic sync and force-replace behavior is retained; external tools handle propagation and conflict copies as documented in both languages.

This independent branch uses the existing payload schema. Saved command data also travels through the folder when the separate command-sync feature is installed (Refs #238); portable private key paths remain a separate feature (Refs #237).

Closes #240

Testing

go test -race ./internal/cloudsync ./internal/config ./internal/app -run 'Test(LocalFolder|LocalSync|SyncProviderSettingsStayLocal|SyncLocal|SyncUsesChangedLocalDestination|SyncSwitchesProvider)' -count=1
go vet ./...
go tool mygo vet
  • File backend tests cover stale versions, external edits/deletion, concurrent app writes, cancellation, size limits, failed-write preservation and an external tool replacing a transported lock file. Relative-path tests cover changes in startup working directory.
  • A two-device app test transports real encrypted files between different directories and verifies hosts, settings, independent edits, deletion and local-only configuration. Password-only credential loading, switching providers/destinations and discarding an old in-flight result are covered.
  • English and Simplified Chinese headless UI tests cover provider selection, path persistence, incremental input with spaces, the folder picker and password storage; screenshots below were reviewed.
  • Focused race tests and vets pass. The four feature branches were combined in a scratch worktree; focused race tests pass and production Go sources match the combined custom app.
  • Windows backend tests pass under Wine; the combined custom app cross-builds for Windows amd64. Native Windows/macOS UI and real third-party file propagation were not tested.
  • Complete combined regression: other packages pass. The app package completes with go test -race -timeout 20m ./internal/app in 610 seconds after the default 600-second package limit was reached. Only three failures remain, reproduced on unchanged base 78c2f91: TestBackgroundImage, TestBackgroundReadsOffUIThread and TestCommandBarPage. All added tests pass; no race reports were found.
Local folder options (English and Simplified Chinese)

English Local folder options

Simplified Chinese Local folder options

Prepared with Codex.

Keep each destination local and transport the encrypted sync file with the user’s own tool. Compare content versions under a persistent OS lock in the local cache and write through a temporary file. Add regression coverage for external lock replacement and relative destination identities.

Closes TooonyChen#240

Prepared with Codex.

This branch has not been deployed

No deployments
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.

feat(cloudsync): add a local folder sync provider

1 participant