fix(sync): apply exclusion filter to gist-sync plugin export path (#47)#48
Open
kipavy wants to merge 3 commits into
Open
fix(sync): apply exclusion filter to gist-sync plugin export path (#47)#48kipavy wants to merge 3 commits into
kipavy wants to merge 3 commits into
Conversation
The plugin runtime's exportState invoked backup_export without the excluded_ids argument. Since the Rust param is Option, an absent value deserialized to None and strip_excluded early-returned, so the outbound blob contained every object — including ones marked cloud-off, along with their secret material — which then left the device for the user's gist. Export getExcludedObjectIds() from the sync service and thread it into the plugin exportState → backup_export invoke, mirroring the built-in server push(). Excluding an object now keeps it off every sync destination, not just the built-in server. Add a runtime test asserting exportState forwards the excluded-id set into backup_export.
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.
Fixes #47.
Problem
Per-object / per-type sync exclusion (
cloud-off) was enforced only on the built-in server push (fixed in #43). The gist-sync plugin export path calledbackup_exportwithout theexcluded_idsargument:Because the Rust param is
Option<Vec<String>>, an absent argument deserializes toNone, sostrip_excludedearly-returns and the blob contains every object — including ones markedcloud-off, along with their secret material (passwords, private keys). For a user relying on gist-sync, an excluded Host/Identity/SSH Key still leaves the device.Fix
getExcludedObjectIds()helper fromsrc/services/sync.ts(was file-private).exportState→backup_exportinvoke, mirroring the built-in serverpush().Excluding an object now keeps it off every sync destination, not just the built-in server. Both
backup_exportcall sites in the codebase supply the filter; no other plugin export paths were missing it.Tests
src/plugins/runtime.exportState.test.tsassertsexportStateforwards the excluded-id set intobackup_export(red before the fix, green after).tsc --noEmitclean; existing sync + plugin suites pass (36 tests, no regressions).🤖 Generated with Claude Code
https://claude.ai/code/session_01RnVt37SuhKfm94kpkh8rez