-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: Route notifications to FCM (Android) #171
Conversation
Google Cloud Messaging has been deprecated in favor of FCM, and as of May 29, 2019 it no longer functions.
Also renamed the Content-Encoding header field to "encoding", which is what the rest of autopush/webpush expects.
This will make testing easier, for example with mockito.
This fixes the integration tests, because sometimes users would not have any router data in DynamoDB. Also, just to be safe, router_data uses rusoto's AttributeValue instead of serde_json::Value.
This allows us to use DynamoDbUser with any version of rusoto.
64c6f5f
to
14abb92
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
We can probably make the gateway 404 == user delete a different issue, since it will hit all the routers.
let client = self.clients.get(app_id).ok_or(FcmError::InvalidAppId)?; | ||
trace!("Sending message to FCM: {:?}", message_data); | ||
if let Err(e) = client.send(message_data, fcm_token.to_string(), ttl).await { | ||
return Err(self.handle_error(e)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The python version was recently updated to drop UAIDs for users when we get a NOTFOUND from the bridge. We should replicate that here. It would also help trim up the router table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added: #190
Major changes:
Minor changes:
.gitguardian.yml
to ignore the fake OAuth credentials used during the FCM tests. config docsoperation_notes.md
about how to set nested settings via environment variables.deny_unknown_fields
)InsertOpt
trait toautopush_common
to make conditionally inserting anOption
into aHashMap
easier.Closes #162