bitfireat / webdav-push Goto Github PK
View Code? Open in Web Editor NEWWebDAV Push: Draft
WebDAV Push: Draft
Create a Nextcloud app that sends a Push over POST to a pre-defined URL (of the Push Director) as soon as a contact / event / task changes. Until it's ready, we can simulate this by sending the POST over curl.
When the server pushes notifications to the client, it'll have to send a specific payload.
I'm opening this issue with the intent of discussing and agreeing on the format for this payload.
I think that using XML is probably the best choice. That's really a sentence I never though I'd write (I'm not a huge fan of XML), but I think it's the logical choice given that CalDav is already using XML. Any client can be expected to be able to parse and handle this already, and an extension to CalDav should really just use the same underlying format.
In particular, I think that the message that servers "push" to clients, could include a payload very similar to the result of a PROPFIND
querying the etag
for the element that has changed:
<?xml version="1.0" encoding="utf-8" ?>
<D:multistatus xmlns:D="DAV:"
xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:response>
<D:href>http://cal.example.com/bernard/work/abcd2.ics</D:href>
<D:propstat>
<D:prop>
<D:getetag>"fffff-abcd2"</D:getetag>
</D:prop>
<D:status>HTTP/1.1 200 OK</D:status>
</D:propstat>
</D:response>
</D:multistatus>
This tells the client which resource has changed and is enough for the client determine what course of action they want to take (usually, fetch the updated resource).
Aggregation of multiple entries (e.g.: multiple response
nodes with a different href
each) should be perfectly valid.
I suggest these steps to get a first demo of DAVx⁵ with Push:
md5(collection URL)
,I'd put code like the demonstration Push Director into this repository for now, too.
For vdirsyncer (and probably for other native desktop/server applications), having a websocket where messages indicating updates are sent would be the logical choice. It builds on HTTP (which is already the base here), and should be usable by clients without additional infrastructure (aside from the CalDav server itself).
However, I understand that for Android and iOS this MUST go through a third party server which then relays connections. Support for UnifiedPush aligns very closely with those requirements too, so I think it makes sense to keep these three in the same bag.
Is it even feasible to have a proxy service connecting WS->Apple and WS->Google? It seems that the client implementation would be messy, since it's not the client itself that subscribes to notifications, but this unusual proxy.
To summarize this a bit, a client can subscribe to push notifications with a server, but may want one of two approaches:
On top of this, the webhooks themselves need a payload format specific to what Apple/Google/UnifiedPush expect. Again, the only thing that comes to mind here is a proxy that does this conversion, since I can't imagine an extension to CalDav taking into account the nuances of these third party services.
I'm curious to hear more about what kind of designs you have in mind; I'm sure you've given this aspect a lot more though.
POST /push
messages, but in their format).Prepare DAVx5 so that it supports FCM and initates a sync when it receives a notification.
Is this Push implementation only meant to work with Nextcloud? Personally, I'm not the biggest fan of Nextcloud, but I'm using SabreDAV with some patches. I'm very interested to have this also working with standard SabreDAV. I had a discussion with evert some years ago about the same topic, but we came to no real starting point.
Hopefully this will change now.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.