Give SyncLink a collection, a slot, unbind and a lookup by UID (#326) #1079
No reviewers
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo!1079
Loading…
Reference in a new issue
No description provided.
Delete branch "326-synclink-slots"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The DAV plugin's next improvements need a link to say three things it could
not: which collection a twin lives in, which of a record's several twins it
is, and that a person undid a pairing. A plugin cannot own tables (#228), so
they belong on SyncLink.
collectionis the address of the address book, calendar or task listholding the twin. A UID is unique only within its collection (RFC 6352
§5.1, RFC 4791 §4.1), so a twin is keyed on both and
remote_hrefis acache.
slotis free text a plugin chooses; blank is the only twin, which everyexisting row is. One link per (connection, record, slot) replaces one per
(connection, record).
for_recordandbindtakeslot="",of_modelreturns every slot.
set, so one remote item is paired with one record.
bindraisesAlreadyPaired, carrying the link that holds the item, instead of a bareIntegrityError. It is on the plugin surface.
unbindkeeps the row and setsunpaired_at, the maintainer's option (b):a plugin pairing by UID would otherwise pair the two again on its next run.
An unpaired row does not count towards the rule above.
bindpairs again,clearing
unpaired_atand, unless passed,remote_gone.for_remote(connection, collection, uid)finds the paired link, else theone most recently unpaired.
The migration adds the three columns blank, so it keeps every link, including
two holding one UID on a re-added connection (postulo/postulo-dav#7), which
the new rule does not reach while their collection is blank. Pairings stay
out of the personal export. No admin registration: the admin is off unless
POSTULO_ADMIN_URL is set (#116) and holds nobody's records (#368).
Closes #326
Notes for review
SyncLinkgains three fields:slot, so one record can have several twins: unique on (connection, record, slot);collection, so one item belongs to one record: unique on (connection, collection, uid) for paired rows;unpaired_at, plus apairedproperty.for_remote;bind(slot=…), which raises the new surface nameAlreadyPairedinstead of a database error;unbind, which keeps the row and stampsunpaired_at, as the issue recommends.plugins 0013_synclink_slots. Every existing link is kept.POSTULO_ADMIN_URLis set (#116), and it holds nobody's records by rule (#368,test_admin_exposure).link.pairedbefore #327 can unpair links, filed there.🤖 Generated with Claude Code
c7ee4ec421c3355db385c3355db3854ea7edd5f9