Skip to content

notifications: integrate webpush dispatcher into rest of notifications subsystem #573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks
johnstcn opened this issue Apr 10, 2025 · 1 comment
Open
3 tasks
Assignees

Comments

@johnstcn
Copy link
Member

johnstcn commented Apr 10, 2025

coder/coder#17091 added a webpush package that supports sending notifications over WebPush.

This was not integrated into the rest of the notifications subsystem because its preferred mode of usage is more akin to UDP than the existing "TCP" reliable notification delivery system.

In order to integrate this properly, we'll need to do the following:

  1. Add the ability to immediately dispatch a notification while skipping the enqueuing process. This should be a new code path and should not be configurable by end-users (i.e. "immediate dispatch" versus "retry dispatch" should be hard-coded by design)

  2. Add the ability to dispatch a notification with an arbitrary message body. This should only be possible with arbitrary dispatch for now, as the current architecture for retryable dispatch requires a template to be stored in the database.

  3. Add the webpush dispatcher as a "first-class" notification target.

Notes:

We'll have to be very careful about how we name things here so as not to conflate "webpush" notifications with the concept of a "notification" in coder/coder.

Tasks:

  • Allow immediately* dispatching a notification.
  • Add the ability to dispatch a notification with an arbitrary message body
  • Add the webpush notifier as a "first-class" notification target

* or as close to immediately as possible

@johnstcn
Copy link
Member Author

Alternative implementation:

  • Add LISTEN/NOTIFY support for notification dispatch to reduce time-to-dispatch for notifications. This is already a TODO called out in existing code.
  • Leverage existing 7-day cutoff for deleting old notification messages.

This should enable us to keep a single code path for both kinds of notifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant