Skip to content

feat(api-service): Preference webhook subscriber ID fixes NV-7110#10016

Merged
scopsy merged 1 commit intonextfrom
cursor/NV-7110-preference-webhook-subscriber-id-fc6c
Feb 12, 2026
Merged

feat(api-service): Preference webhook subscriber ID fixes NV-7110#10016
scopsy merged 1 commit intonextfrom
cursor/NV-7110-preference-webhook-subscriber-id-fc6c

Conversation

@scopsy
Copy link
Contributor

@scopsy scopsy commented Feb 12, 2026

What changed? Why was the change needed?

This PR resolves NV-7110.

The subscriberId has been added to the preference.updated webhook payload. This change allows consumers of the webhook to identify which specific subscriber's preferences were updated, eliminating the need for full synchronizations of all subscriber preferences and reducing load on the user preferences endpoint.

Specifically:

  • The WebhookPreferenceDto now includes a subscriberId field.
  • The UpdatePreferences use case now includes the subscriberId in the preference.updated webhook payload.
  • The SendWebhookMessageCommand payload type was updated to allow primitive values for additional fields, accommodating the subscriberId string.

Screenshots

N/A


Linear Issue: NV-7110

Open in Cursor Open in Web

NV-7110: Add subscriberId to the preference.updated webhook payload to allow
consumers to identify which subscriber's preferences were updated without
requiring a full sync of all subscriber preferences.

- Add subscriberId field to WebhookPreferenceDto
- Include command.subscriberId in webhook payload when preferences are updated
- Update SendWebhookMessageCommand payload type to allow primitive values

Co-authored-by: Dima Grossman <dima@grossman.io>
@cursor
Copy link
Contributor

cursor bot commented Feb 12, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@linear
Copy link

linear bot commented Feb 12, 2026

@netlify
Copy link

netlify bot commented Feb 12, 2026

Deploy Preview for dashboard-v2-novu-staging canceled.

Name Link
🔨 Latest commit 116697b
🔍 Latest deploy log https://app.netlify.com/projects/dashboard-v2-novu-staging/deploys/698dadf8e4b4aa00082d9bbf

@scopsy scopsy changed the title Preference webhook subscriber ID feat(api-service): Preference webhook subscriber ID fixes NV-7110 Feb 12, 2026
@scopsy scopsy marked this pull request as ready for review February 12, 2026 10:43
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

Walkthrough

This pull request introduces changes to webhook functionality across three files. A new subscriberId field is added to the WebhookPreferenceDto with corresponding Swagger metadata. The UpdatePreferences use case is modified to include subscriberId in the webhook payload. Additionally, the payload property type in SendWebhookMessageCommand is broadened from [key: string]: Record<string, unknown> | undefined; to [key: string]: unknown; to allow more flexible value types.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding subscriberId to the preference webhook payload to resolve NV-7110.
Description check ✅ Passed The description provides clear context about the changes, explaining why subscriberId was added to the webhook payload and detailing the specific modifications made.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
libs/application-generic/src/webhooks/usecases/send-webhook-message/send-webhook-message.command.ts (1)

14-19: Broadening payload index signature to unknown reduces type safety for all webhook events.

The change from Record<string, unknown> | undefined to unknown is the minimal fix to accommodate a string subscriberId, but it also means any future payload field can be any type (e.g., a number, array, or null) without compile-time enforcement.

Consider a narrower union if you want to retain some guardrails:

♻️ Suggested alternative
  `@IsDefined`()
  payload: {
    object: Record<string, unknown>;
    previousObject?: Record<string, unknown>;
-   [key: string]: unknown;
+   [key: string]: Record<string, unknown> | string | undefined;
  };

This keeps the index signature compatible with existing Record<string, unknown> values, the new string value (subscriberId), and optional fields, while still preventing accidentally passing unexpected types like number[] or boolean.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@scopsy scopsy merged commit 92bbf96 into next Feb 12, 2026
33 of 34 checks passed
@scopsy scopsy deleted the cursor/NV-7110-preference-webhook-subscriber-id-fc6c branch February 12, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants