-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Show only one update available notification at a time #37595
Conversation
@DylanDylann Please 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] |
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
@DylanDylann What should be added for the screenshots? This change is about the notifications count, does it still need screenshots? |
@ShridharGoel Please update screenshot/video for this PR. And I think we should have a mock to test this change |
For testing: Added this code in Expensify.js to emulate a set of updates becoming available at intervals of 5 seconds:
Mac.Web.One.Notif.movMac.Desktop.One.Notif.mov |
@DylanDylann The videos can be found above. |
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.
reviewing
src/libs/Notification/LocalNotification/BrowserNotifications.ts
Outdated
Show resolved
Hide resolved
@ShridharGoel Please follow this comment to sign CLA |
src/libs/Notification/LocalNotification/BrowserNotifications.ts
Outdated
Show resolved
Hide resolved
I have read the CLA Document and I hereby sign the CLA |
Reviewer Checklist
only can test on desktop App Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktopnotification.MOV |
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
This is a reference about tag property
For testing on dev:
Many same notifications display at the same time because we have multiple updates and each update triggers a notification.
To reproduce it, we need to add 2 notification creators in Expensify.tsx
useEffect(() => {
const interval = setInterval(() => {
console.log("Update available 1")
LocalNotification.showUpdateAvailableNotification();
}, 15000);
return () => clearInterval(interval);
}, [])
useEffect(() => {
const interval = setInterval(() => {
console.log("Update available 2")
LocalNotification.showUpdateAvailableNotification();
}, 15000);
return () => clearInterval(interval);
}, [])
src/libs/Notification/LocalNotification/BrowserNotifications.ts
Outdated
Show resolved
Hide resolved
src/libs/Notification/LocalNotification/BrowserNotifications.ts
Outdated
Show resolved
Hide resolved
src/libs/Notification/LocalNotification/BrowserNotifications.ts
Outdated
Show resolved
Hide resolved
@ShridharGoel it looks like some of the commits on this PR are not signed. It's possible to revise them, but it's probably more simple to recreate the PR. Review the guidelines for more info. |
@ShridharGoel Could you run "npm run prettier" before commiting code? About unsigned commit, you can squash commit and push again with a signed commit |
We need to sign commits with GPG Keys as in the guideline |
I had followed the same steps, checking again |
@DylanDylann Updated. |
@arosiclair Please help to trigger workflows again. Thanks |
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 LGTM. @ShridharGoel can you confirm the Notification.tag
property correctly replaces the old notification on both web and desktop (testing with just one useEffect
)?
@arosiclair Tested on both web and desktop, it is working fine. |
@ShridharGoel We failed the perf test. Please check if it relates to this PR. |
Also please help to merge the latest main |
I merged the latest main locally and tested it well |
Does not seem related. |
🚀 Deployed to staging by https://github.com/arosiclair in version: 1.4.51-0 🚀
|
@ShridharGoel @DylanDylann Not sure if QA team can test. We need to wait for multiple deploys. Could you help with this please? |
@kavimuru Can you modify Expensify.tsx and run a build locally? This can be done: #37595 (comment) Otherwise, we might have to just go through sanity check to ensure other things are working fine and skip this part since there's no direct way of testing apart from waiting for deploys or changing the code. |
@ShridharGoel Applause QA team don't have access. But we can validate
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.4.51-3 🚀
|
Details
Show only one update available notification at a time.
Fixed Issues
$ #36081
PROPOSAL: #36081 (comment)
Tests
Offline
Does not have any changes related to offline flow.
QA 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Mac.Web.One.Notif.mov
MacOS: Desktop
Mac.Desktop.One.Notif.mov