spacedriveapp / spacedriveapp/spacedrive
feat(sync): wire ChangeType::Delete / sync_model for tag deletion, unapply, and apply paths
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 39k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
Overview
Several tag mutation code paths skip cross-device sync propagation even though the sync infrastructure already supports ChangeType::Delete and sync_model. Until these are wired, peers will diverge silently: deleted/unapplied tags remain on other devices; applied tags may never be broadcast.
Raised from PR #3044 (discussion: https://github.com/spacedriveapp/spacedrive/pull/3044#discussion_r2983003277).
Affected locations
1. Tag deletion — core/src/ops/tags/delete/action.rs (line 101)
// TODO(sync): Tag deletion is not synced to other devices.
// The sync infrastructure supports ChangeType::Delete but the tag deletion
// path does not yet call library.sync_model() with it.
Call library.sync_model(..., ChangeType::Delete) after a successful delete_tag and handle / log errors.
2. Tag unapply — core/src/ops/tags/unapply/action.rs (line 110)
// TODO(sync): Tag unapply is not synced to other devices.
// The sync infrastructure supports ChangeType::Delete but tag removal
// does not yet call library.sync_model().
Call library.sync_model(..., ChangeType::Delete) for each removed user_metadata_tag row after the bulk delete and handle / log errors.
3. Tag apply (metadata manager) — core/src/ops/metadata/manager.rs (lines 530, 547, 568)
Three call sites that map the result of apply_semantic_tags silently discard the returned models instead of looking up the actual UUID and calling sync_model:
.map(|_| ()) // TODO: Look up actual UUID and sync models
These should retrieve the inserted / updated user_metadata_tag rows, then call library.sync_model(..., ChangeType::Insert) (or Update) for each.
Acceptance criteria
-
tags.deletepropagates the deletion to peers viasync_modelwithChangeType::Delete. -
tags.unapplypropagates removed tag associations to peers viasync_modelwithChangeType::Delete. - The three
apply_semantic_tagscall sites inmetadata/manager.rssync inserted/updated rows to peers. - All inline
TODO(sync)and// TODO: Look up actual UUID and sync modelscomments in the above files are removed and replaced with a reference to this issue (e.g.// tracked in #<issue>) until resolved, then removed entirely on completion. - No new silent divergence paths are introduced for tag mutations.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing sync infrastructure and the affected paths in core/src/ops/tags/delete/action.rs, core/src/ops/tags/unapply/action.rs, and core/src/ops/metadata/manager.rs. Compare nearby library.sync_model calls and trace the models returned by delete_tag, the bulk unapply, and apply_semantic_tags. Done means all listed tag mutations propagate the appropriate changes, errors are handled, and the noted TODO comments are resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100