-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
refactor: Remove unused notification code #22833
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
Removes `useRegisterPushNotificationsEffect` and related unused code, including: - `hasInitialNotification` from `app/util/notifications/methods/common.ts` - `getInitialNotification` and `onBackgroundEvent` from `app/util/notifications/services/NotificationService.ts` - `useRegisterPushNotificationsEffect.ts` and its test file - The usage of `useRegisterPushNotificationsEffect` in `useNotificationHandler`
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
| * Lists notifications on startup. | ||
| */ | ||
| const useNotificationHandler = () => { | ||
| useRegisterPushNotificationsEffect(); |
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 effect is not needed anymore.
We register push notifications through the FCMService, and this is done at an engine level.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsFallback: AI analysis did not complete successfully. Running all tests. |
| return formatAmount(numericAmount); | ||
| }; | ||
|
|
||
| export const hasInitialNotification = async () => |
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 method is not used anymore, we've consolidated getting the first initial push notification on the engine level.
| observer: (event: NotifeeEvent) => Promise<void>, | ||
| ): (() => void) => notifee.onForegroundEvent(observer); | ||
|
|
||
| onBackgroundEvent = (observer: (event: NotifeeEvent) => Promise<void>) => |
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 is not used anymore. We are not using notifee for background push notifications but directly firebase.
| await notifee.cancelTriggerNotification(id); | ||
| }; | ||
|
|
||
| getInitialNotification = async (): Promise<InitialNotification | null> => |
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 is not used anymore. We are not using notifee for getting the initial push notification but directly firebase.
|



Description
Removes
useRegisterPushNotificationsEffectand related unused code, including:hasInitialNotificationfromapp/util/notifications/methods/common.tsgetInitialNotificationandonBackgroundEventfromapp/util/notifications/services/NotificationService.tsuseRegisterPushNotificationsEffect.tsand its test fileuseRegisterPushNotificationsEffectinuseNotificationHandlerChangelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-1552
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Removes useRegisterPushNotificationsEffect and initial/background notification handlers/utilities, updating hooks, tests, and NotificationService accordingly.
useRegisterPushNotificationsEffectand its test file.hooks/index.ts; only calluseStartupNotificationsEffect.hooks/index.test.tsxto assert onlyuseStartupNotificationsEffectis invoked.services/NotificationService.ts):getInitialNotificationandonBackgroundEventwrappers and related imports/types.onForegroundEvent, badge count helpers, and display flow intact.methods/common.ts):notifeeimport andhasInitialNotificationhelper.withTimeoutand other utilities unchanged.Written by Cursor Bugbot for commit 7b1c858. This will update automatically on new commits. Configure here.