Arsnael commented on a change in pull request #701: URL: https://github.com/apache/james-project/pull/701#discussion_r730720304
########## File path: src/adr/0050-jmap-web-push.md ########## @@ -0,0 +1,70 @@ +# 50. Implement web push for JMAP + +Date: 2021-10-18 + +## Status + +Accepted (lazy consensus). + +Not yet implemented. + +## Context + +**Notification for newly received emails** is a common feature of modern mail applications. Furthermore, +**real time** updates across devices are a common feature. We wish to provide support for this on top +of Apache James JMAP implementation for a large variety of devices. + +Dealing with mobile devices yield a unique set of challenges at the protocol level, including +low bandwidth connection, long latencies, and the need to save battery. As such, mobile devices +operating systems tend to limit background connections for applications. Thus, in order to receive +notifications when the application is running on the background, one cannot rely on +[ADR 0047](0047-jmap-push-over-websockets.md) (JMAP websocket push) - as it would imply +the application maintaining a persistent connection to the server, which is battery/network +consuming. + +As such, [RFC-8620 section 7.2](https://jmap.io/spec-core.html#pushsubscription) `JMAP specification for web push` +introduces the use of [RFC-8030](https://datatracker.ietf.org/doc/html/rfc8030) `Generic Event Delivery Using HTTP Push` +using an intermediate push server: a Push Gateway is used by the device to multiplex all push of all applications on a +single connection. The device then register the URL of its push gateway on the application server (here JMAP server) for +it to forward `StateChange` events to the push gateway. + +## Decision + +Implement [RFC-8620 section 7.2](https://jmap.io/spec-core.html#pushsubscription) `JMAP specification for web push`. + +We will store StateChanges, provide a Cassandra implementation of this storage for the Distributed application. + +We will implement a PushClient based on reactor-netty to send events to the push gateway. + +We will rely on a Group listener plugged on the JMAP event bus to handle the web push - See +[ADR 37: Event bus](0037-eventbus.md). + +We will implement the `PushSubscription/get` and `PushSubscription/set` JMAP methods. + +We will also implement the verification code mechanism (a first round-trip to verify the push gateway works well). + +We also decided to allow a single push subscription per devideId (which includes device and APP identifier...) + +## Consequences + +The notification traffic transit by some third party infrastructure which can both be a security and privacy risk. Review comment: ```suggestion The notification traffic transits by some third party infrastructure which can both be a security and privacy risk. ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
