Skip to content

Remove the unused push notification prompt and Firebase messaging stack - #34

Merged
manuelgeek merged 1 commit into
feat/home-redesign-planfrom
fix/remove-notifications-prompt
Aug 5, 2026
Merged

Remove the unused push notification prompt and Firebase messaging stack#34
manuelgeek merged 1 commit into
feat/home-redesign-planfrom
fix/remove-notifications-prompt

Conversation

@manuelgeek

Copy link
Copy Markdown
Member

Closes #33.

The site asked every first-time visitor for notification permission, but I never actually send push notifications. It was a permission prompt for a channel with no traffic, and it was the first thing a visitor saw.

I removed the whole dead stack rather than just hiding the modal, since nothing else used any of it:

  • NotificationsPrompt.tsx and its render in components/layouts/default.tsx
  • pages/api/notification.ts — the FCM topic-subscribe route, whose only caller was the modal
  • firebase/util/index.ts — Firebase init, only ever consumed by messaging
  • public/firebase-messaging-sw.js — the background-message service worker
  • utils/constants.ts — it held only NOTIFICATIONS, so the file was empty afterwards
  • public/images/notif.svg — the modal artwork
  • the firebase dependency, plus the six now-dead NEXT_PUBLIC_FIREBASE_* / NEXT_PUBLIC_MESSAGING_TOPIC vars in .env.example

Kept react-toastifySessionFeedback still uses it. utils/helpers.ts stays too, since isClient has three other consumers.

Verified with yarn lint (clean) and yarn build (succeeds). The yarn.lock diff is a Firebase-only prune.

Based on feat/home-redesign-plan rather than dev, since I branched off it — merge #24 first and this retargets cleanly.

One thing to note: visitors who already granted permission still have firebase-messaging-sw.js registered in their browser. Deleting the file stops new registrations, but existing ones linger until they expire. Harmless given nothing is being sent — happy to add an explicit unregister if you'd rather flush them.

…g stack

The site prompted every first-time visitor for notification permission,
but no push notifications are ever sent. Remove the modal along with the
rest of the dead stack: the FCM topic-subscription API route, the
Firebase app init, the background-message service worker, the
NOTIFICATIONS constant and its now-empty module, the modal artwork, the
firebase dependency, and the unused NEXT_PUBLIC_FIREBASE_* and
NEXT_PUBLIC_MESSAGING_TOPIC entries in .env.example.

react-toastify stays; SessionFeedback still uses it.

Closes #33

@NewtonMutugi NewtonMutugi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@manuelgeek
manuelgeek merged commit 65d01b5 into feat/home-redesign-plan Aug 5, 2026
1 check passed
@manuelgeek
manuelgeek deleted the fix/remove-notifications-prompt branch August 5, 2026 07:32
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.

2 participants