Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/authenticated-user-storage/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ export type WalletActivityAccount = {
enabled: boolean;
};

export type AgenticCliPreference = {
inAppNotificationsEnabled: boolean;
pushNotificationsEnabled: boolean;
};

export type WalletActivityPreference = {
inAppNotificationsEnabled: boolean;
pushNotificationsEnabled: boolean;
Expand Down Expand Up @@ -109,6 +114,7 @@ export type NotificationPreferences = {
marketing: MarketingPreference;
perps: PerpsPreference;
socialAI: SocialAIPreference;
agenticCli: AgenticCliPreference;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validation schema missing new agenticCli field

High Severity

The NotificationPreferences type now requires agenticCli, but NotificationPreferencesSchema in validators.ts was not updated to include a corresponding agenticCli field. The assertNotificationPreferences function uses this schema to validate API responses, then asserts the data is NotificationPreferences. This means API data missing agenticCli will pass validation, yet downstream code will trust it's present — causing runtime undefined access errors.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a732e09. Configure here.

};

// ---------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export const MOCK_NOTIFICATION_PREFERENCES: NotificationPreferences = {
'e8f2a1b3-5c4d-4e6f-8a9b-2c3d4e5f6a7b',
],
},
agenticCli: {
inAppNotificationsEnabled: true,
pushNotificationsEnabled: false,
},
};

export const MOCK_ASSETS_WATCHLIST_BLOB: AssetsWatchlistBlob = {
Expand Down
Loading