Check SyncLink.paired: a link can now be unpaired (core #326, before #327) #43

Open
opened 2026-10-28 16:05:15 +00:00 by tiagoagueda · 0 comments
Owner

Core #326 (SyncLink slots) changes what SyncLink.for_record can return. A link may now be unpaired: unbind keeps the row and sets unpaired_at, and the new link.paired property says whether it still pairs the record with its twin.

The DAV plugin treats any link that for_record returns as paired. Nothing calls unbind yet, so this is harmless today. Core #327 (a page to pair and unpair records with their remote items) will call it, and from then on the plugin would keep writing to a twin the person unpaired.

What to do

  • Wherever the plugin reads a link (for_record, of_model), skip or re-pair links whose paired is false.
  • Use the new slot and collection where a record has more than one twin, or an item has a collection. Key a twin on (collection, uid), as the wiki's Writing a plugin → Syncs now says.
  • Catch AlreadyPaired from bind, which replaces the database's integrity error.
  • Repin core past #326, and add a test that an unpaired link is not written to.

Needed before core #327 ships.

Core #326 (`SyncLink` slots) changes what `SyncLink.for_record` can return. A link may now be **unpaired**: `unbind` keeps the row and sets `unpaired_at`, and the new `link.paired` property says whether it still pairs the record with its twin. The DAV plugin treats any link that `for_record` returns as paired. Nothing calls `unbind` yet, so this is harmless today. Core #327 (a page to pair and unpair records with their remote items) will call it, and from then on the plugin would keep writing to a twin the person unpaired. ## What to do - Wherever the plugin reads a link (`for_record`, `of_model`), skip or re-pair links whose `paired` is false. - Use the new `slot` and `collection` where a record has more than one twin, or an item has a collection. Key a twin on (collection, uid), as the wiki's *Writing a plugin → Syncs* now says. - Catch `AlreadyPaired` from `bind`, which replaces the database's integrity error. - Repin core past #326, and add a test that an unpaired link is not written to. Needed before core #327 ships.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo-dav#43
No description provided.