-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(sync): wire ChangeType::Delete / sync_model for tag deletion, unapply, and apply paths #3045
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: #3044 (comment)).
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 modelsThese 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.