Import a single contact from a connected CardDAV address book #98
Labels
No labels
area:auth
area:ci
area:db
area:infra
area:native
area:pwa
area:service
epic
feature
foundation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
james/carol#98
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Bulk-importing a whole address book is the wrong shape for Carol — most contacts in a CardDAV book aren't relevant to a user's career-network model. The right shape is selective: when adding a contact, the user should be able to search their address book for one specific person and pull them in, instead of retyping name / email / phone / org by hand.
User-facing shape
Next to the existing "New contact" action, add a split / dropdown control:
Selecting "Import from Address Book…" opens a modal (or inline panel) with:
Peoplerow in Carol, scoped to the calling user, and closes the modal back into wherever the user invoked it from (the People list, an Organization page, etc.).The dropdown's import option is disabled (with a tooltip / link to settings) when no CardDAV connection exists for the user.
Prereq: a CardDAV connection foundation ticket
This ticket assumes the user has already configured a CardDAV server — URL, credentials, which address books to expose. That setup deserves its own ticket because:
Suggested split: a sibling "CardDAV connection setup" ticket that adds Settings → Integrations → CardDAV (URL + username + password + discovered address books), and this ticket consuming that connection. Happy to file that separately when this ticket is picked up — flag in PR or comment.
Scope (this ticket)
Assuming the connection exists:
addressbook-queryREPORT (RFC 6352 §8.6) over client-side filtering of a full-book fetch. Servers that don't honour the REPORT filter degrade to client-side filtering with a clear log.Peoplefield mapping (see below).UID— re-importing the same contact updates the existingPeoplerow rather than duplicating.vCard →
Peoplefield mappingMap the standard vCard properties Carol's
Peopleshape can hold; surface unmapped properties in a singlenotesfield rather than dropping them silently:PeoplefieldFNnameEMAILemailTYPE=PREFor first listed. Carry the rest intonotes.TELphoneORGorganizationOrganizationsrow for the user by normalized name, link by FK; create one if not found (same scoping rules apply).TITLE/ROLEroleBDAYbirthdayPeoplecarries this field today; otherwise drop tonotes.URLnotesTYPE.NOTEnotesUIDexternal_idREVexternal_updatedAnything else (photo, geo, X-extensions): out of scope for v1. Photo support is interesting but it's an image-pipeline question, not a contact-shape question — file as a follow-up if/when it matters.
Acceptance criteria
Peoplerow scoped to the calling user, with the vCard mapping above, and the modal closes back to where the user invoked it.UID) updates the existingPeoplerow in place rather than creating a duplicate. Field-level changes from CardDAV overwrite Carol's values — see "Conflict policy" question below.ORGis matched against the user's existing organizations by normalized name; a new one is created if no match. The createdOrganizationsrow is also scoped to the calling user.Design questions to settle before implementation
tsdavis the actively-maintained TS CardDAV/CalDAV client and would cut a real amount of XML wrangling, at the cost of one more devDep (withlavamoat.allowScriptsimplications per ADR-0010). Hand-rolling againstfetch+ an XML parser is feasible but every server's quirk becomes our problem. tsdav is the recommended starting point; revisit if it pulls in too much.addressbook-queryis unavailable. Some CardDAV servers (or specific address books) don't honor the property-filter REPORT. Fall back to a full-book fetch + client-side filter? Or refuse, log, and tell the user "this address book doesn't support server-side search"? Lean toward fallback for usability but with a server-side log.Out of scope today
Part of epic #2. Depends on a "CardDAV connection foundation" ticket (file separately).