Fix Discord notifications not firing for new signups#935
Merged
Conversation
Two bugs prevented notifications: 1. getOriginResourceCount counted deprecated resources, so re-registrations of origins with only deprecated resources were treated as existing (count > 0) and silently skipped the notification. Now filters to deprecatedAt: null. 2. The facilitator sync cron job created origin records without notifications. Origins first discovered by the sync job would already exist when the merchant later registered manually, preventing the notification. Now snapshots origin counts before upserting and fires notifyNewServer for any origin that goes from 0 to >0 active resources.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Facilitator-discovered origins are automated, not real signups — they shouldn't trigger merchant research follow-up. Added merchantResearch option to notifyNewServer (defaults true), sync job passes false.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getOriginResourceCountnow excludes deprecated resources — previously counted all resources including deprecated ones, so re-registrations of origins with only deprecated resources were silently treated as existing and skipped the notification.notifyNewServernow accepts amerchantResearchoption — defaults totrue(existing behavior unchanged), but the sync job passesfalsesince facilitator-discovered origins aren't real signups.Test plan
DISCORD_NOTIFICATIONS_WEBHOOK_URLis set in Vercel for x402scan