Skip to content

FEAT Push notification preferences per category #1200 FIXED - #1221

Open
madisonsc52-del wants to merge 1 commit into
Samuel1-ona:mainfrom
madisonsc52-del:FEAT-Push-notification-preferences-per-category-#1200-FIX
Open

FEAT Push notification preferences per category #1200 FIXED#1221
madisonsc52-del wants to merge 1 commit into
Samuel1-ona:mainfrom
madisonsc52-del:FEAT-Push-notification-preferences-per-category-#1200-FIX

Conversation

@madisonsc52-del

Copy link
Copy Markdown

Findings

The repository already contained notification infrastructure, but it lacked complete user-facing and cross-device preference control:

  1. Mobile preferences were local-only

    • Stored in AsyncStorage.
    • Changes were not synchronized to another phone or the web application.
  2. Web preferences were browser-only

    • Stored in localStorage.
    • There was no wallet-scoped server preference record.
  3. No notification preference API existed

    • The existing /api/v1/ routes did not include an endpoint for reading or saving notification preferences.
  4. The web settings page was not available in the active web App Router

    • A settings component existed outside the effective apps/web/app route structure.
    • A working web route was added under apps/web/app/settings/page.tsx.
  5. Web push used device-level flags

    • Push delivery could use stale preferences from an individual subscription.
    • It did not consistently use the player’s canonical wallet preferences.
  6. Some notification channels bypassed the global mute

    • Favorite hunt alerts could still trigger.
    • Weekly rank digests could still be generated.
    • Mobile scheduled and background notifications did not consistently check preferences.
  7. Push route merge artifacts were present

    • push-tokens/route.ts and push/send/route.ts contained duplicate implementations from a merge conflict.

Fix Features

The implementation now provides:

  • Independent notification category toggles:

    • Hunt Events
    • Rewards & Progress
    • Social & Competition
    • Achievements
  • A global Mute all notifications control.

  • Wallet-scoped preference synchronization through:

/api/v1/notifications/preferences
  • PostgreSQL persistence using:
notification_preferences
  • Mobile preference synchronization using the connected wallet address.

  • Web preference hydration when a wallet connects.

  • Server-side push filtering using the canonical wallet preference document.

  • Global/category filtering for:

    • Web push notifications
    • Mobile foreground notifications
    • Mobile background notifications
    • Scheduled hunt reminders
    • Favorite hunt start alerts
    • Rank notifications
    • Weekly rank digests
  • Push subscription preference synchronization for global and category settings.

  • New API tests covering:

    • Default preferences
    • Independent category changes
    • Global mute persistence
    • Wallet isolation
    • Invalid request handling
  • Repaired duplicate push API route implementations so the notification infrastructure has one valid implementation per route.

CLOSE #1200

@madisonsc52-del

Copy link
Copy Markdown
Author

@Samuel1-ona
PLEASE REVIEW AND MERGE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Push notification preferences per category

1 participant