-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Style notifications using onyxData, increase payload bandwidth #15857
Conversation
@parasharrajat @jasperhuangg One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
...d/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java
Show resolved
Hide resolved
@jasperhuangg @parasharrajat @arosiclair @cristipaval Ready for testing now. I used physical devices, but I think these steps should work fine on an emulator. DM me if you want me to save you all the setup steps and I'll send you a signed release apk file you can install to any emulator or physical device! |
I just realized @parasharrajat won't be able to complete the dev env tests. I'm pretty sure you can simply create a release build from this branch and just test against staging though 👍 |
@jasperhuangg I'm preemptively sending you the signed apk file as I'm heading out now. Same you you @cristipaval @arosiclair, but no pressure to review if you're too busy |
@parasharrajat I'll remove you for review from this, I'll handle screenshots |
All the test cases seem to work as expected for me except for test case 3. It seems the split bill notification appears in the same thread for me as the message that I sent into that same group. Could I be missing something? |
if (message.containsKey(PAYLOAD_KEY)) { | ||
try { | ||
JsonMap payload = JsonValue.parseString(message.getExtra(PAYLOAD_KEY)).optMap(); | ||
|
||
// Apply message style only for report comments | ||
if (REPORT_COMMENT_TYPE.equals(payload.get(TYPE_KEY).getString())) { | ||
// Apply message style when onyxData is present |
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.
to clarify, this has to be Onyx data that we receive from Pusher? Urban Airship? just curious
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.
For Android/iOS we receive the onyxData update from both Pusher (only when the app is open) and Airship (we get the push notification regardless of whether the app is alive/killed).
So in this code we only care that the notification data includes onyxData. I'll update the comment to make this a bit clearer.
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.
I updated this and another comment, hope that clarifies things a bit!
Hey @jasperhuangg thanks for thorough testing. I should have explained better, but that is expected because you sent that message from the group chat. This is the logic for showing in multiple threads: DM
Group chat
There are some existing bugs which break the thread logic, but based on what you said I think this is totally expected 👍 |
@jasperhuangg please take another look, I think we're good here now. What you saw was expected. |
@Julesssss Thanks for your patience was OOO, grabbing screenshots now and will merge when done! |
Ahh sorry, I can't seem to get any notifications on my android emulator and I can't figure out why, can someone else help with screenshots? |
@jasperhuangg I'd ask for help from someone with a physical deice, or to use browser stack (though I haven't tested notifications using that service). It's much easier using a compiled build on a physical device. |
Tried a number of things and still am not getting any notifications on my Android emulator @cristipaval @arosiclair Reached out on NewDot DMs for help with this, let's get this merged! |
Reviewer Checklist
Screenshots/VideosWebN/A Mobile Web - ChromeN/A Mobile Web - SafariN/A DesktopN/A iOSN/A |
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.
Tests well for me 👍🏽
Thanks, I'm going to merge as we've had two successful tests now. @jasperhuangg do you remember if you switched the airship keys? That might be the missing step. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
I'm pretty sure I did, I took everything you removed from this commit and added it back locally: 3d816d3 |
Ah cool, next time we can try debugging together 👍 |
🚀 Deployed to staging by https://github.com/Julesssss in version: 1.2.89-0 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.2.89-0 🚀
|
Details
The notification payload size limit is 4kb and going over this causes the notification to be dropped by FCM. To resolve multiple issues we need to reduce the amount of payload data that is being sent unnecessarily. This PR prepares for this by switching the notification data source from reportComment to the onyxData, allowing us to remove lots of duplicate fields once this PR has been deployed to users.
Fixed Issues
$ #14849
$ https://github.com/Expensify/Expensify/issues/269103
$ https://github.com/Expensify/Expensify/issues/260142
$ #15423
[UNBLOCKS] #14715
[UNBLOCKS] https://github.com/Expensify/Expensify/issues/265452
Tests
Screenshots for each of these tests are at the bottom of this description.
Setup steps
1) Verify that messages longer than 115 chars are no longer being truncated
"
symbol at the end2) Verify that messages and 1:1 IOU requests are displayed correctly
3) Verify that bill split messages are displayed correctly
Offline tests
N/A -- notifications cannot be received while the device is offline
QA Steps
Run the above tests, ignoring the setup steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Notes:
1) Verify that messages longer than 115 chars are no longer being truncated
2) Verify that messages and 1:1 IOU requests are displayed correctly
3) Verify that bill split messages are displayed correctly