-
Notifications
You must be signed in to change notification settings - Fork 399
notif: Parse new format of notification payloads found in E2EE notifs #2074
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
Conversation
We'll stop needing these with the new E2EE notifications, because the notification payloads will come to us as actual JSON rather than as a string-string map. Start by getting our hands on them more concretely.
This reflects the names used in the new E2EE notifications API.
The new post-E2EE versions will diverge from the pre-E2EE forms in enough ways that this will become cleaner than our usual approach of expressing the old forms as modifications of the new.
This should be NFC in the live app: it doesn't change the parsing, only the toJson methods, and we never use those methods on these types outside of tests. (That's because in the live app we only ever consume these objects, not send them.)
We already ignore these fields in any case, which is why this doesn't require any changes outside the tests.
We don't actually consult this field when parsing, which is why this doesn't require any changes outside the tests.
…ring for group DMs
…format complete! With this change, our test fixtures are now fully updated to reflect the documented new form of these payloads.
|
@rajveermalviya Would you include a round of manual testing that notifications still work correctly with this PR? I think our tests should be thorough enough to catch any breakage there. But this is a high-value area of the app, and this PR makes a lot of changes to it, so it's worth us spending a bit of time to make extra sure. |
rajveermalviya
left a comment
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.
Thanks @gnprice! LGTM, and everything is working great when doing a round of manual tests of notifications on Android for 1-1 DMs, group DMs and channel messages across multiple realms.
|
Great, thanks for that testing! Merging. |
There were a number of incidental changes to the format of notification payloads which we decided to make in tandem with the switch to E2EE notifications (#1764). The new format is documented, more or less, here:
https://zulip.com/api/mobile-notifications#payload-examples
This PR has us start understanding the new format, while continuing to parse the old format and produce the same internal data types as for the new format.
This doesn't yet include the actual decryption; that'll be for a future PR.