- Notifications
You must be signed in to change notification settings - Fork906
fix: ensure targets are propagated to inbox#16985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -74,7 +74,7 @@ func (s *StoreEnqueuer) EnqueueWithData(ctx context.Context, userID, templateID | ||
dispatchMethod = metadata.CustomMethod.NotificationMethod | ||
} | ||
payload, err := s.buildPayload(metadata, labels, data, targets) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Is it the first time we're processing targets? Before we merge this one, I'd like to understand the use case. AFAIR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I see, I missed the context. Obviously it is too late for this feedback, so ignore the comment 👍 | ||
if err != nil { | ||
s.log.Warn(ctx, "failed to build payload", slog.F("template_id", templateID), slog.F("user_id", userID), slog.Error(err)) | ||
return nil, xerrors.Errorf("enqueue notification (payload build): %w", err) | ||
@@ -132,9 +132,9 @@ func (s *StoreEnqueuer) EnqueueWithData(ctx context.Context, userID, templateID | ||
// buildPayload creates the payload that the notification will for variable substitution and/or routing. | ||
// The payload contains information about the recipient, the event that triggered the notification, and any subsequent | ||
// actions which can be taken by the recipient. | ||
func (s *StoreEnqueuer) buildPayload(metadata database.FetchNewMessageMetadataRow, labels map[string]string, data map[string]any, targets []uuid.UUID) (*types.MessagePayload, error) { | ||
payload := types.MessagePayload{ | ||
Version: "1.2", | ||
NotificationName: metadata.NotificationName, | ||
NotificationTemplateID: metadata.NotificationTemplateID.String(), | ||
@@ -144,8 +144,9 @@ func (s *StoreEnqueuer) buildPayload(metadata database.FetchNewMessageMetadataRo | ||
UserName: metadata.UserName, | ||
UserUsername: metadata.UserUsername, | ||
Labels: labels, | ||
Data: data, | ||
Targets: targets, | ||
// No actions yet | ||
} | ||
Uh oh!
There was an error while loading.Please reload this page.