-
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
Fix clearing read push notifications on Android (#33568) #35304
Fix clearing read push notifications on Android (#33568) #35304
Conversation
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.
LGTM, just one small suggestion.
...d/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java
Outdated
Show resolved
Hide resolved
LGTM! |
…ficationListener.java
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.
Looking really good so far! Can we also test group DMs and rooms to make sure those display correctly as well? Thanks!
// Add all conversation messages to the notification, including the last one we just received. | ||
for (NotificationMessage cachedMessage : notificationData.messages) { | ||
messagingStyle.addMessage(cachedMessage.text, cachedMessage.time, notificationData.getPerson(cachedMessage.accountID)); | ||
NotificationCompat.MessagingStyle previousStyle = NotificationCompat.MessagingStyle.extractMessagingStyleFromNotification(existingReportNotification.getNotification()); |
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.
Are we sure existingReportNotification
is not null
here? I think when receiving the first notification for a room it would be.
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.
Yes, at this point, we are certain that a previous notification exists. The if
statement above checks the hasExistingNotification
variable, which precisely determines whether the report notification is null or not.
In the case of the first notification, it would bypass this if statement's body and simply add additional data to the extras.
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.
You're right, it's the case for the group chats. Thanks for pointing it out
...d/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java
Outdated
Show resolved
Hide resolved
Hi @arosiclair I wanted to re-test this PR but I have a problem with receiving notifications - it occurs on main as well for me. The notification payload |
I also noticed this issue on staging. I'll take a look |
@robertKozik this should be fixed now! |
please merge main, though not much overlap. 2.5k+ commits are behind |
Thanks @arosiclair! I've filled the checklist with screenshots from group DMs and room chats @situchan merged! |
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 thanks for the changes 👍. @situchan please review
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-02-09.at.9.56.03.PM.movScreen.Recording.2024-02-09.at.9.57.49.PM.movAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
@situchan How is the review going? |
I was testing on various android devices. completing today |
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.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/arosiclair in version: 1.4.40-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.40-5 🚀
|
Details
This PR removes Notification Cache from android native in favour of native Android Notification API.
Fixed Issues
$ #33568
PROPOSAL: #33568 (comment)
Tests
Repeat following test steps for DMs, group DMs and room chats
Offline tests
N/A
QA Steps
Same as test steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.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
Android: Native
1:1 chat:Screen.Recording.2024-01-29.at.23.26.05.mov
group chat:
room:
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop