Skip to content

fix: update push onchain notif detection#9407

Open
zelkibuilds wants to merge 4 commits into
mainfrom
fix/update-push-onchain-notif-detection
Open

fix: update push onchain notif detection#9407
zelkibuilds wants to merge 4 commits into
mainfrom
fix/update-push-onchain-notif-detection

Conversation

@zelkibuilds

@zelkibuilds zelkibuilds commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Explanation

After the v4 Notification API migration (#9384), isOnChainRawNotification still used legacy heuristics (id and payload.data must be defined). v4 on-chain push payloads are discriminated by notification_type === 'wallet_activity', so the old check could reject valid notifications and web push handling in push-utils.ts would bail out early.

This PR updates isOnChainRawNotification to delegate to the existing isOnChainNotification type guard, which uses the v4 notification_type discriminator. The function now narrows to OnChainNotification (the unprocessed v4 shape) instead of OnChainRawNotification (the normalised shape with a type field added by toRawAPINotification). That matches the push flow: discriminate first, then normalise via toRawAPINotification.

No other packages were changed. No dependency upgrades.

Changelog entry:

Fixed

  • Update isOnChainRawNotification to detect on-chain notifications using the v4 notification_type discriminator instead of legacy payload field checks, fixing web push notification handling after the v4 API migration (#9407)

References

  • Fixes GE-343
  • Follow-up to the v4 API migration in #9384
  • Affects web push handling in NotificationServicesPushController/web/push-utils.ts

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Single-function detection fix in notification-services-controller with no auth or data-model changes; main caveat is the type guard now narrows to OnChainNotification instead of OnChainRawNotification.

Overview
Fixes web push dropping valid on-chain payloads after the v4 Notification API migration by updating isOnChainRawNotification to use the v4 discriminator instead of legacy shape checks.

The guard no longer requires id and payload.data to be defined; it delegates to isOnChainNotification (notification_type === 'wallet_activity'). The narrowed type is now OnChainNotification (unprocessed v4 API shape), matching the push path in push-utils.ts: discriminate first, then toRawAPINotification.

Changelog updated under Fixed for this package.

Reviewed by Cursor Bugbot for commit 77c4b5b. Bugbot is set up for automated code reviews on this repo. Configure here.

@zelkibuilds zelkibuilds self-assigned this Jul 7, 2026
@zelkibuilds zelkibuilds marked this pull request as ready for review July 7, 2026 14:40
@zelkibuilds zelkibuilds requested review from a team as code owners July 7, 2026 14:40
@zelkibuilds zelkibuilds changed the title fix/update push onchain notif detection fix: update push onchain notif detection Jul 7, 2026
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