-
Notifications
You must be signed in to change notification settings - Fork 5k
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: Avoid to send the snap notification id to the notifications server #25099
Conversation
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. |
useState<MarkAsReadNotificationsParam>([]); | ||
|
||
useEffect(() => { | ||
const handleOnClick = () => { |
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.
Nice, we did not need an effect! ❤️
trackEvent({ | ||
category: MetaMetricsEventCategory.NotificationInteraction, | ||
event: MetaMetricsEventName.MarkAllNotificationsRead, | ||
}); | ||
|
||
// Mark all metamask notifications as read | ||
markNotificationAsRead(notificationReadArray); | ||
markNotificationAsRead(notificationsRead); |
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.
I got really confused since we were filtering out snap notifications.
But yes this method (as the comment above mentions) is only for wallet notifications, so we can filter out these notifications.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #25099 +/- ##
===========================================
- Coverage 65.66% 65.65% -0.01%
===========================================
Files 1359 1359
Lines 54014 54012 -2
Branches 14015 14017 +2
===========================================
- Hits 35464 35459 -5
- Misses 18550 18553 +3 ☔ View full report in Codecov by Sentry. |
Builds ready [b8622ca]
Page Load Metrics (47 ± 3 ms)
Bundle size diffs
|
Description
This PR fixes a bug related to the "Mark all notifications as read" button. The button is responsible, when clicked, for performing the actions to mark a notification as read. In the case of on-chain notifications, this state needs to be saved via API on the notification server. The PR prevents the IDs of SNAP notifications from being sent to the server, as their read/unread state is managed differently.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist