Page MenuHomePhorge

WIP: Server Side Events
Needs ReviewPublic

Authored by machniak on Wed, Jun 19, 3:23 PM.
Tags
None
Referenced Files
F13481415: D4803.id13758.diff
Mon, Jul 1, 4:39 PM
F13480305: D4803.id13753.diff
Mon, Jul 1, 4:04 PM
F13460094: D4803.id.diff
Mon, Jul 1, 12:17 PM
Unknown Object (File)
Sun, Jun 30, 1:57 PM
Unknown Object (File)
Sat, Jun 29, 11:17 PM
Unknown Object (File)
Sat, Jun 29, 5:30 PM
Unknown Object (File)
Sat, Jun 29, 12:43 PM
Unknown Object (File)
Sat, Jun 29, 7:50 AM
Subscribers
Restricted Project

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary
Test Plan

none yet

Diff Detail

Repository
rK kolab
Branch
dev/push
Lint
Lint Skipped
Unit
No Test Coverage
Build Status
Buildable 47760
Build 18129: arc lint + arc unit

Event Timeline

machniak created this revision.
  • Workaround KTOR client bug, add development commands to send push notifications
mollekopf added inline comments.
src/app/Backends/Events.php
46

In the firebase case the notification_token is a separate token that identifies the channel to the device. We could implement the same abstraction I suppose:

  • The device registers with a separate "client_id" as notification token.
  • We use the client_id that is stored in the notification token instead of the device_id.

There's currently a 1:1 mapping between notification tokens and deviceid, so it doesn't buy us anything atm, but may provide more flexibility in the future?

src/app/Http/Controllers/SSEController.php
65

I don't think there is a way to reliably detect dropped connections without sending some data (there's tcp keepalive, which sends data, but I'm not sure we can rely on that here).

If we want to guarantee delivery of notifications there needs to be a protocol for acknowledgement from the client and retransmission otherwise.

src/routes/api.php
210

We can get the user from the guard, but if we want device/client specific notifications I think we need an id (The companion app code uses device_id rather than client_id, and until we have multiple clients on the same device they are probably going to be the same). I don't think we initially have device specific notifications, but one could foresee the need based different purposes.

I suppose we could map this to oauth scopes, but then again, we already have the companion app entry with some config, so I suggest to leave the id in there.