Commit 2ee8a9f
authored
refactor: Remove unused notification code (#22833)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
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`
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: null
## **Related issues**
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-1552
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Removes useRegisterPushNotificationsEffect and initial/background
notification handlers/utilities, updating hooks, tests, and
NotificationService accordingly.
>
> - **Notifications hooks**:
> - Remove `useRegisterPushNotificationsEffect` and its test file.
> - Stop invoking it in `hooks/index.ts`; only call
`useStartupNotificationsEffect`.
> - Update `hooks/index.test.tsx` to assert only
`useStartupNotificationsEffect` is invoked.
> - **NotificationService (`services/NotificationService.ts`)**:
> - Remove `getInitialNotification` and `onBackgroundEvent` wrappers and
related imports/types.
> - Keep `onForegroundEvent`, badge count helpers, and display flow
intact.
> - **Methods (`methods/common.ts`)**:
> - Remove `notifee` import and `hasInitialNotification` helper.
> - Retain `withTimeout` and other utilities unchanged.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7b1c858. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 76ef8e6 commit 2ee8a9f
File tree
6 files changed
+1
-409
lines changed- app/util/notifications
- hooks
- methods
- services
6 files changed
+1
-409
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
| |||
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 18 | | |
28 | 19 | | |
29 | 20 | | |
30 | 21 | | |
31 | 22 | | |
32 | 23 | | |
33 | | - | |
34 | 24 | | |
35 | 25 | | |
36 | 26 | | |
| |||
39 | 29 | | |
40 | 30 | | |
41 | 31 | | |
42 | | - | |
43 | 32 | | |
44 | 33 | | |
45 | 34 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
5 | | - | |
| 4 | + | |
6 | 5 | | |
7 | 6 | | |
8 | | - | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
| |||
Lines changed: 0 additions & 231 deletions
This file was deleted.
0 commit comments