Skip to content

Commit

Permalink
Sync-token, content change
Browse files Browse the repository at this point in the history
  • Loading branch information
rfc2822 committed Sep 30, 2024
1 parent 9671d22 commit 9314e04
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 16 deletions.
42 changes: 30 additions & 12 deletions content.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -326,30 +326,49 @@ Example: `<expires>Sun, 06 Nov 1994 08:49:37 GMT</expires>`

# Push Notification

[^todo] When content of direct members change. What is this exactly? Typically when CTag / sync-token changes.
A WebDAV-Push server MUST notify registered subscriptions when the content of a subscribed collection changes, this is when a member is added, changed or removed.

[^todo] Data vs. metadata, only about members or also the subscribed collection itself? CalDAV/CardDAV: subscribe home-set?
This means that a notification is sent whenever the `{DAV:}sync-token` as described in {{RFC6578}} (or the historical `{http://calendarserver.org/ns/:}GetCTag`) changes.

[^todo] Data vs. metadata, only about members or also the subscribed collection itself?

[^todo]CalDAV/CardDAV: subscribe home-set?


## Push Message

The push message body contains the topic of the changed collection.
The push message body contains a `{DAV:propstat}` element with

* an optional `{DAV:}status` element to notify the client that the collection has changed its status, and
* a `{DAV:}prop` element that

* MUST contain the `topic` of the affected collection so that the client can identify it without doubt,
* SHOULD contain a `{DAV:}sync-token` element (when available) to allow a client to ignore the push message (and for instance, skip synchronization) when it already knows the latest state,
* MUST NOT contain elements with sensitive data (unless message encryption is used).

Sample push message body:
When the `{DAV:}status` element is present, it indicates a change of the status of the collection itself (and not its members). In this case, clients SHOULD check and process the relevant properties of the collection. Status code 404 or 410 is used to indicate that the collection has been removed.

Sample message body 1:

~~~
{::include xml/sample-push-message.xml}
{::include xml/sample-push-message1.xml}
~~~

Here, the contents of the collection with topic `O7M1nQ7cKkKTKsoS_j6Z3w` have changed and the new sync-token (after the change) is `http://example.com/ns/sync/1234`.

Sample message body 2:

~~~
{::include xml/sample-push-message2.xml}
~~~

Here the server notifies the client that the collection with topic `O7M1nQ7cKkKTKsoS_j6Z3w` is no longer available on the server.

[^todo] Push notification rate limit?

[^todo] Shall a TTL value, as used by Web Push, be recommended in general, per transport, or not at all?

[^todo] Shall multiple enqueued (and not yet delivered) push messages for the same collection be merged to a
single one (like "Replacing Push Messages" with the `Topic` header in {{RFC8030}})? Maybe use a
timestamp? Shall this be specified in general, per transport or not at all?

[^todo] CTag / sync-token?
[^todo] Shall multiple enqueued (and not yet delivered) push messages for the same collection be merged to a single one (like "Replacing Push Messages" with the `Topic` header in {{RFC8030}})? Maybe use a timestamp? Shall this be specified in general, per transport or not at all?

[^todo] How often / batch / delay?

Expand Down Expand Up @@ -531,5 +550,4 @@ Example for a subscription registration requesting message encryption:
{::include xml/sample-registration-with-encryption.xml}
~~~

The server uses these data to encrypt the payload and send it to the push service. The client then decrypts the payload again.

The server uses these data to encrypt the payload and send it to the push service. The client then decrypts the payload again.
1 change: 1 addition & 0 deletions webdav-push.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ normative:
RFC9110:

informative:
RFC6578:
UnifiedPush:
title: UnifiedPush
target: https://unifiedpush.org
Expand Down
4 changes: 0 additions & 4 deletions xml/sample-push-message.xml

This file was deleted.

7 changes: 7 additions & 0 deletions xml/sample-push-message1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:propstat xmlns:D="DAV:" xmlns:P="DAV:Push">
<D:prop>
<P:topic>O7M1nQ7cKkKTKsoS_j6Z3w</P:topic>
<D:sync-token>http://example.com/ns/sync/1234</D:sync-token>
</D:prop>
</D:propstat>
7 changes: 7 additions & 0 deletions xml/sample-push-message2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<D:propstat xmlns:D="DAV:" xmlns:P="DAV:Push">
<D:status>404 Not Found</D:status>
<D:prop>
<P:topic>O7M1nQ7cKkKTKsoS_j6Z3w</P:topic>
</D:prop>
</D:propstat>

0 comments on commit 9314e04

Please sign in to comment.