-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Route notifications to autopush connection servers (#167)
* Generate a message ID for each notification * Use a default TTL of 0 in NotificationHeaders * Impl Serialize for Notification and NotificationHeaders * Add a Router trait and stub WebPushRouter * Use async_trait in Router and add RouterResponse * Implement direct-route-to-node happy-path for WebPushRouter * Replace serde Serialize notification impls with more direct impls * Add DynamoStorage::remove_node_id and use in webpush router The Router async functions may not return Send futures, so the async_trait annotation is modified to not require Send. * Add DynamoStorage::store_message and use in webpush router * Add a UserNotFound error kind to the common code and use in get_uaid * Try to notify the node after storing a message, if available * Remove the `updates.client.deleted` metric Based on metrics spreadsheet discussion. * Add RouterType enum for easy matching on the router type * Take notification by reference when routing * Add Routers extractor and use in webpush_route * Add endpoint_url setting and remove unused database settings * Remove settings banner, as actix already logs the data as INFO * Fix the Location header TODO in webpush router * Add RouterError * Fix incorrect usage of UserNotFound error (remove it) * Return the router response from the HTTP handler * Fix missing Clone impl (rebase error) * Fix serialization of WebPush notifications Notifications were serialized without required fields (due to `skip_serializing` in the autopush-common code). While this is correct when giving the notification to the UA, the connection server needs these fields. We now perform this serialization separately from the autopush-common Notification serialization. * Add debug and trace level logging to the WebPush router * Ignore local configs * Fix wrong content encoding key in header map WebPush expects "encoding" instead of "content_encoding" * Return an error if there is no TTL value * Fix NotificationHeader tests after requiring TTL * Update errnos for RouterError and NoTTL Closes #161
- Loading branch information
1 parent
91d483a
commit e73dff1
Showing
18 changed files
with
626 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,6 @@ target | |
requirements.txt | ||
test-requirements.txt | ||
venv | ||
|
||
# Local configs | ||
*.local.toml |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.