Skip to content

chore: remove Happening Now notifications#3902

Merged
idoshamun merged 2 commits into
mainfrom
eng-1568-remove-support-of-happening-now-notifications
May 24, 2026
Merged

chore: remove Happening Now notifications#3902
idoshamun merged 2 commits into
mainfrom
eng-1568-remove-support-of-happening-now-notifications

Conversation

@idoshamun
Copy link
Copy Markdown
Member

Summary

Removes the "Happening Now" (MajorHeadlineAdded) notification end-to-end: the worker stops generating notifications when a post is highlighted as Breaking, and all server-side wiring is removed. The Highlights feature itself (the majorHeadlines GraphQL query that feeds the /highlights page) is intentionally kept — only notifications are removed.

Changes

  • Delete the majorHeadlineAdded worker, its registration in src/workers/notifications/index.ts, and the Pub/Sub subscription in .infra/common.ts.
  • Remove the MajorHeadlineAdded value from NotificationType, its default in DEFAULT_NOTIFICATION_SETTINGS, the entry in notificationFlagsSchema, the OneSignal "Happening now" heading, the email noop, the NotificationMajorHeadlineContext type, and the title/builder in notifications/generate.ts.
  • Remove the DismissedMajorHeadlinesAlertsBanner value from UserActionType (the apps banner that produced it is also being removed).
  • Drop the now-unused getHighlightLink helper and NotificationIcon.Megaphone enum value.
  • Delete the corresponding integration test.

Key decisions

  • Highlights remain: only the notification surface is removed. PostHighlightedMessage and the api.v1.post-highlighted topic stay because newHighlightRealTime still consumes them.
  • No data migration: existing rows in user_action with dismissed_major_headlines_alerts_banner and any leftover major_headline_added keys in notificationFlags JSONB will simply be ignored — harmless and not worth a migration.

Test plan

  • pnpm run build (full tsc) clean
  • eslint --max-warnings 0 on changed files clean
  • Grep across repo confirms zero leftover references
  • Jest: __tests__/notifications.ts, __tests__/highlights.ts, __tests__/workers/notifications.ts, __tests__/workers/newNotificationV2{Mail,Push,RealTime}.ts — 234 passing

Closes ENG-1568


Created by Huginn 🐦‍⬛

idoshamun and others added 2 commits May 24, 2026 10:49
Drop the MajorHeadlineAdded notification worker, type, schema, OneSignal
mapping, and dismiss-banner UserAction. Highlights display
(majorHeadlines query) is unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Megaphone NotificationIcon was only used by the removed
MajorHeadlineAdded builder.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pulumi
Copy link
Copy Markdown

pulumi Bot commented May 24, 2026

🍹 The Update (preview) for dailydotdev/api/prod (at 01b1945) was successful.

✨ Neo Explanation

This is a routine feature removal of the "major headline added" notification system, including its Pub/Sub subscription, worker, and all supporting code. ✅ Low Risk — no stateful data loss beyond the expected deletion of the Pub/Sub subscription and orphaned user notification flag data.

This PR removes the MajorHeadlineAdded notification feature entirely — the worker, notification type, push heading, email template mapping, notification flags schema entry, and associated Pub/Sub subscription are all being deleted. The DismissedMajorHeadlinesAlertsBanner user action enum value is also removed. The Kubernetes deployment/cron image updates and migration job rotation are standard release mechanics tied to the new commit SHA.

🔵 Info — The GCP Pub/Sub subscription api-sub-api.major-headline-added-notification (on topic api.v1.post-highlighted) is being permanently deleted. Any messages in flight or unacknowledged at the time of deletion will be lost. If the publisher (api.v1.post-highlighted) is still actively emitting events, those will continue to be published but will go unconsumed with no subscription to receive them — this is benign as long as no other subscriber depends on this subscription.

The MajorHeadlineAdded enum value is being removed from NotificationType and the notification flags schema. Existing user records in the database that have notificationFlags.major_headline_added set will retain that JSON key as orphaned data — the new code simply ignores it, so no runtime errors are expected, but the DB schema and live data will be inconsistent until cleaned up.

Resource Changes

    Name                                                    Type                           Operation
~   vpc-native-update-achievement-rarity-cron               kubernetes:batch/v1:CronJob    update
-   vpc-native-api-db-migration-36e15097                    kubernetes:batch/v1:Job        delete
~   vpc-native-clean-expired-better-auth-sessions-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-rotate-daily-quests-cron                     kubernetes:batch/v1:CronJob    update
~   vpc-native-materialize-monthly-best-post-archives-cron  kubernetes:batch/v1:CronJob    update
~   vpc-native-user-posts-analytics-refresh-cron            kubernetes:batch/v1:CronJob    update
~   vpc-native-daily-digest-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-deployment               kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-gifted-plus-cron                       kubernetes:batch/v1:CronJob    update
~   vpc-native-expire-super-agent-trial-cron                kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-old-notifications-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-channel-highlights-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-images-cron                     kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-user-companies-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-update-highlighted-views-cron                kubernetes:batch/v1:CronJob    update
~   vpc-native-private-deployment                           kubernetes:apps/v1:Deployment  update
~   vpc-native-update-tag-materialized-views-cron           kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-clickhouse-cron               kubernetes:batch/v1:CronJob    update
~   vpc-native-calculate-top-readers-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-rotate-weekly-quests-cron                    kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-users-cron                      kubernetes:batch/v1:CronJob    update
+   vpc-native-api-db-migration-ba83bb5f                    kubernetes:batch/v1:Job        create
+   vpc-native-api-clickhouse-migration-ba83bb5f            kubernetes:batch/v1:Job        create
~   vpc-native-squad-posts-analytics-refresh-cron           kubernetes:batch/v1:CronJob    update
~   vpc-native-bg-deployment                                kubernetes:apps/v1:Deployment  update
~   vpc-native-user-profile-updated-sync-cron               kubernetes:batch/v1:CronJob    update
~   vpc-native-worker-job-deployment                        kubernetes:apps/v1:Deployment  update
~   vpc-native-channel-digests-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-hourly-notification-cron                     kubernetes:batch/v1:CronJob    update
~   vpc-native-update-trending-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-materialize-yearly-best-post-archives-cron   kubernetes:batch/v1:CronJob    update
-   vpc-native-api-clickhouse-migration-36e15097            kubernetes:batch/v1:Job        delete
~   vpc-native-update-views-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-generic-referral-reminder-cron               kubernetes:batch/v1:CronJob    update
~   vpc-native-ws-deployment                                kubernetes:apps/v1:Deployment  update
~   vpc-native-personalized-digest-cron                     kubernetes:batch/v1:CronJob    update
~   vpc-native-generate-search-invites-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-clickhouse-cron       kubernetes:batch/v1:CronJob    update
~   vpc-native-update-current-streak-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tags-str-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-opportunities-cron              kubernetes:batch/v1:CronJob    update
... and 13 other changes

@idoshamun idoshamun merged commit 58e4c3e into main May 24, 2026
9 checks passed
@idoshamun idoshamun deleted the eng-1568-remove-support-of-happening-now-notifications branch May 24, 2026 11:20
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.

1 participant