-
Notifications
You must be signed in to change notification settings - Fork 453
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
feat: notifications renewal [SW-631] #4699
base: dev
Are you sure you want to change the base?
Conversation
Branch preview✅ Deploy successful! Storybook: |
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success1752 tests passing in 237 suites. Report generated by 🧪jest coverage report action from 79b6be6 |
@tmjssz please rebase to the new dev, the src folder got moved to |
…ons token version for each safe in local storage
…als and preferences for safes
…sage on app open
…wal process in the Push Notifications settings
…PushNotifications
79b6be6
to
f7aa0b5
Compare
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🟡 | Statements | 74.04% (-0.05% 🔻) |
14642/19777 |
🔴 | Branches | 51.43% (-0.19% 🔻) |
3481/6769 |
🔴 | Functions | 56.97% (-0.1% 🔻) |
2072/3637 |
🟡 | Lines | 75.57% (-0.05% 🔻) |
13285/17579 |
Show new covered files 🐣
St.❔ |
File | Statements | Branches | Functions | Lines |
---|---|---|---|---|---|
🟡 | ... / useNotificationsTokenVersion.ts |
73.33% | 38.46% | 60% | 71.43% |
🟡 | ... / useNotificationsRenewal.ts |
69.35% | 21.43% | 46.67% | 71.19% |
Show files with reduced coverage 🔻
St.❔ |
File | Statements | Branches | Functions | Lines |
---|---|---|---|---|---|
🔴 | ... / GlobalPushNotifications.tsx |
61.97% (-0.41% 🔻) |
39.71% | 58.73% | 59.04% (-0.42% 🔻) |
🟢 | ... / useNotificationPreferences.ts |
86.81% (+0.45% 🔼) |
50% (+10% 🔼) |
75.76% (-4.89% 🔻) |
87.06% (+1.52% 🔼) |
🟢 | ... / logic.ts |
85% (-13.04% 🔻) |
40% (-40% 🔻) |
83.33% (-16.67% 🔻) |
85.45% (-12.42% 🔻) |
🔴 | ... / index.tsx |
32.69% (-2.72% 🔻) |
0% | 0% | 35.42% (-3.22% 🔻) |
Test suite run success
1752 tests passing in 237 suites.
Report generated by 🧪jest coverage report action from 1bae52d
📦 Next.js Bundle Analysis for @safe-global/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖
|
Page | Size (compressed) |
---|---|
global |
1.04 MB (🟡 +53.07 KB) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
Thirty-two Pages Changed Size
The following pages changed size from the code in this PR compared to its base branch:
Page | Size (compressed) | First Load |
---|---|---|
/ |
508 B (🟢 -2 B) |
1.04 MB |
/address-book |
23.07 KB (🟡 +4 B) |
1.06 MB |
/apps |
35.8 KB (🟡 +2.08 KB) |
1.08 MB |
/apps/custom |
33.87 KB (🟡 +2.08 KB) |
1.07 MB |
/apps/open |
55.59 KB (🟡 +1.98 KB) |
1.1 MB |
/balances |
29.74 KB (🟡 +38 B) |
1.07 MB |
/balances/nfts |
9.52 KB (🟢 -24 B) |
1.05 MB |
/bridge |
2.56 KB (🟡 +1 B) |
1.04 MB |
/cookie |
8.77 KB (🟡 +1 B) |
1.05 MB |
/home |
61.38 KB (🟡 +2.12 KB) |
1.1 MB |
/new-safe/advanced-create |
26.39 KB (🟢 -68 B) |
1.07 MB |
/new-safe/create |
25.52 KB (🟢 -67 B) |
1.07 MB |
/new-safe/load |
6.08 KB (🟢 -5 B) |
1.05 MB |
/privacy |
14.57 KB (🟡 +2 B) |
1.05 MB |
/settings/appearance |
2.25 KB (🟡 +2 B) |
1.04 MB |
/settings/environment-variables |
3.27 KB (🟢 -1 B) |
1.04 MB |
/settings/modules |
4.06 KB (🟡 +1 B) |
1.04 MB |
/settings/notifications |
6.41 KB (🟢 -14.9 KB) |
1.05 MB |
/settings/safe-apps |
20.35 KB (🟡 +2.08 KB) |
1.06 MB |
/settings/security |
2.34 KB (🟡 +1 B) |
1.04 MB |
/settings/setup |
30.69 KB (🟢 -46 B) |
1.07 MB |
/share/safe-app |
7.56 KB (🟢 -5 B) |
1.05 MB |
/stake |
618 B (🟢 -1 B) |
1.04 MB |
/swap |
759 B (🟢 -1 B) |
1.04 MB |
/terms |
12.93 KB (🟡 +1 B) |
1.05 MB |
/transactions |
98.66 KB (🟡 +2.09 KB) |
1.14 MB |
/transactions/history |
98.62 KB (🟡 +2.09 KB) |
1.14 MB |
/transactions/messages |
60.27 KB (🟡 +1.97 KB) |
1.1 MB |
/transactions/msg |
56.52 KB (🟡 +1.97 KB) |
1.1 MB |
/transactions/queue |
49.38 KB (🟡 +1.98 KB) |
1.09 MB |
/transactions/tx |
48.74 KB (🟡 +1.98 KB) |
1.09 MB |
/welcome/accounts |
409 B (🟡 +2 B) |
1.04 MB |
Details
Only the gzipped size is provided here based on an expert tip.
First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link
is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.
5f9ea3d
to
1bae52d
Compare
What it solves
Resolves SW-631
Displays a message prompting users to re-register their token with the new notification service.
Token Versioning
Warning Mechanism
Token Renewal
Feature Flag
All logic is gated by the
RENEW_NOTIFICATIONS_TOKEN
feature flag.How this PR fixes it
NotificationRenewal
component to handle the renewal of notifications with a user interface for signing messages.useNotificationsRenewal
to manage the renewal of notifications, including functions to check if renewal is needed and to perform the renewal.useNotificationsTokenVersion
to manage the token versions for notifications in local storage and to check if the renewal feature is enabled.V2
upon successful registration.useNotificationsRenewal
hook to show the renewal message when the app is opened.NotificationRenewal
component in the push notifications settings page.Additional changes
How to test it
For a specific Safe
For the global settings
Screenshots
notifications-renewal-warning.mp4
Checklist