You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 377ec0b
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/explanation/design.rst
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ Why there's a sync and an async client
17
17
18
18
:class:`~calendaring_jmap.async_client.AsyncJMAPClient` mirrors every public method of :class:`~calendaring_jmap.client.JMAPClient` as a coroutine, rather than the library offering only one and asking callers to wrap it. Both share their parsing and request-building logic through a common base class (``_JMAPClientBase``), so the two clients don't duplicate that logic, only the transport call itself differs (blocking request vs. ``await``).
19
19
20
-
:class:`~calendaring_jmap.objects.calendar.JMAPCalendar` and :class:`~calendaring_jmap.objects.calendar_object.JMAPCalendarObject` need to support both: the same calendar object type is returned whether it came from the sync or the async client, and its methods (``search``, ``add_event``, and similar) need to return a plain value in the sync case and a coroutine in the async case. Python's type system can't narrow a return type based on a runtime flag, so calendaring-jmap uses a generic type parameter on :class:`~calendaring_jmap.objects.calendar.JMAPCalendar` purely for static typing: it lets type checkers give a correctly-typed result depending on whether the calendar came from :meth:`~calendaring_jmap.client.JMAPClient.get_calendars` or :meth:`~calendaring_jmap.async_client.AsyncJMAPClient.get_calendars`, without changing anything at runtime.
20
+
:class:`~calendaring_jmap.objects.calendar.JMAPCalendar` and :class:`~calendaring_jmap.objects.calendar_object.JMAPCalendarObject` need to support both: the same calendar object type is returned whether it came from the sync or the async client, and its methods (``search``, ``add_event``, and similar) need to return a plain value in the sync case and a coroutine in the async case. Python's type system can't narrow a return type based on a runtime flag, so calendaring-jmap uses a generic type parameter on :class:`~calendaring_jmap.objects.calendar.JMAPCalendar` purely for static typing: it lets type checkers give a correctlytyped result depending on whether the calendar came from :meth:`~calendaring_jmap.client.JMAPClient.get_calendars` or :meth:`~calendaring_jmap.async_client.AsyncJMAPClient.get_calendars`, without changing anything at runtime.
21
21
22
22
Why there's a fix up step
23
23
=========================
@@ -27,7 +27,7 @@ Servers can return iCalendar data that doesn't fully comply with :rfc:`5545`: a
27
27
Why CONFERENCE and VCONFERENCE correlate by URI
28
28
===============================================
29
29
30
-
A CONFERENCE property (:rfc:`7986`) and a VCONFERENCE component both describe the same video or phone link, but the spec gives them no shared identifier: iCalendar has no concept of one property pointing at a specific sibling component by ID. The conversion layer matches them by comparing the CONFERENCE property's own value against the VCONFERENCE component's ``URI`` property, string for string. A VCONFERENCE whose URI matches no CONFERENCE property on the same component converts to nothing: there's no VirtualLocation for it to attach its description to.
30
+
A CONFERENCE property (:rfc:`7986`) and a VCONFERENCE component both describe the same video or phone link, but the specification gives them no shared identifier: iCalendar has no concept of one property pointing at a specific sibling component by ID. The conversion layer matches them by comparing the CONFERENCE property's own value against the VCONFERENCE component's ``URI`` property, string for string. A VCONFERENCE whose URI matches no CONFERENCE property on the same component converts to nothing: there's no VirtualLocation for it to attach its description to.
31
31
32
32
Within a matched VCONFERENCE, ``STYLED-DESCRIPTION`` (:rfc:`9073`) is preferred over plain ``DESCRIPTION`` when both are present, since only ``STYLED-DESCRIPTION`` carries a content type. The draft's own ``DERIVED`` parameter decides which one actually describes the conference and which one a server generated from the other: a non-derived ``STYLED-DESCRIPTION`` is treated as the one carrying real content, even when a ``DESCRIPTION`` also happens to be present.
33
33
@@ -39,8 +39,12 @@ A recurrence override patch only needs to carry what actually changed on that on
39
39
Why participants carry ``calendarAddress``, not ``sendTo``
An ``ORGANIZER``/``ATTENDEE`` value is a URI (:rfc:`5545#section-3.3.3`). It doesn't have to use the ``mailto:`` scheme; ``sip:alice@example.com`` is valid too. JSCalendar's Participant ``email`` property is narrower: :rfc:`8984#section-4.4.6` defines it as an :rfc:`5322#section-3.4.1` addr-spec, not an arbitrary URI. So a non-mailto address converts to ``calendarAddress`` as-is, and ``email`` is left unset rather than filled with a value that isn't actually an email address.
43
45
46
+
.. vale Microsoft.Terms = YES
47
+
44
48
JSCalendar's own Participant object defines ``sendTo`` (a map of delivery method to URI), not ``calendarAddress``; the latter belongs to JMAP Calendars' ParticipantIdentity/Principal objects instead. Cyrus doesn't accept ``sendTo`` at all: ``CalendarEvent/set`` rejects it outright with ``invalidProperties`` on both create and update, and requires ``calendarAddress`` in its place. Tested against a running Cyrus container: ``sendTo`` alone is rejected, ``calendarAddress`` alone is accepted, and having both still gets rejected for ``sendTo``. calendaring-jmap sets ``calendarAddress`` to ``sendTo``'s would-be ``imip`` value, its natural equivalent per ParticipantIdentity's own definition, and omits ``sendTo`` entirely. Stalwart accepts the ``calendarAddress``-only form too.
Copy file name to clipboardExpand all lines: docs/how-to/sync.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Fetch a token, then the delta
29
29
for event_id in deleted:
30
30
print("Deleted ID:", event_id)
31
31
32
-
``added`` and ``modified`` are lists of :class:`~calendaring_jmap.objects.calendar_object.JMAPCalendarObject`. ``deleted`` is a list of event IDs: those objects no longer exist on the server, so their data can't be fetched. ``new_state`` is the server's new sync token; chaining straight from it avoids the race window a separate :meth:`~calendaring_jmap.client.JMAPClient.get_sync_token` round trip would open. ``old_state`` is the ``token`` argument echoed back, useful for detecting a server that silently accepted a stale or invalid token instead of reporting an error; see :meth:`~calendaring_jmap.client.JMAPClient.get_objects_by_sync_token`'s own docs for what both Cyrus and Stalwart actually do here. This example ignores ``has_more_changes``, fine for a small change set; see the next section for what it means and how to use it.
32
+
``added`` and ``modified`` are lists of :class:`~calendaring_jmap.objects.calendar_object.JMAPCalendarObject`. ``deleted`` is a list of event IDs: those objects no longer exist on the server, so their data can't be fetched. ``new_state`` is the server's new sync token; chaining straight from it avoids the race window a separate :meth:`~calendaring_jmap.client.JMAPClient.get_sync_token` round trip would open. ``old_state`` is the ``token`` argument echoed back, useful for detecting a server that accepted a stale or invalid token instead of reporting an error; see :meth:`~calendaring_jmap.client.JMAPClient.get_objects_by_sync_token`'s own docs for what both Cyrus and Stalwart actually do here. This example ignores ``has_more_changes``, fine for a small change set; see the next section for what it means and how to use it.
0 commit comments