-
Notifications
You must be signed in to change notification settings - Fork 21
fix: clean up native notification data on wallet deletion and reset #456
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,6 @@ import { Text } from "~/components/ui/text"; | |
| import { useSession } from "~/hooks/useSession"; | ||
| import { IS_EXPO_GO } from "~/lib/constants"; | ||
| import { deregisterWalletNotifications } from "~/lib/notifications"; | ||
| import { removeAllInfo } from "~/lib/notificationsNativeStorage"; | ||
| import { useAppStore } from "~/lib/state/appStore"; | ||
| import { useColorScheme } from "~/lib/useColorScheme"; | ||
| import { cn } from "~/lib/utils"; | ||
|
|
@@ -281,15 +280,18 @@ export function Settings() { | |
| onPress: async () => { | ||
| if (!IS_EXPO_GO) { | ||
| for (const [id, wallet] of wallets.entries()) { | ||
| // clears each wallet's remote push | ||
| // subscription and local notification data; | ||
| // reset() below also clears any remaining | ||
| // native notification data | ||
| await deregisterWalletNotifications( | ||
| wallet, | ||
| id, | ||
| ); | ||
| } | ||
| await removeAllInfo(); | ||
| } | ||
| router.dismissAll(); | ||
| useAppStore.getState().reset(); | ||
| await useAppStore.getState().reset(); | ||
|
Comment on lines
287
to
+294
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift Preserve failed notification deregistration state.
📍 Affects 2 files
🤖 Prompt for AI Agents |
||
| }, | ||
| }, | ||
| ], | ||
|
|
||
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.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Always hide the splash screen after cleanup failure.
If
sweepOrphanedNotificationData()rejects, execution does not reachSplashScreen.hide()on Line 117. The app can remain on the splash screen after a native storage failure. Catch and report cleanup failures, and place splash hiding in afinallyblock.🤖 Prompt for AI Agents