Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2025

Conversation

DanielleMaywood
Copy link
Contributor

@DanielleMaywood DanielleMaywood commented Mar 18, 2025

Currently the targets column in inbox_notifications doesn't get filled. This PR fixes that. Rather than give targets special treatment, we should put it in the payload like everything else. This correctly propagates notification targets to the inbox table without much code change.

Rather than give targets special treatment, we should put it in the
payload like everything else. This correctly propagates notification
targets to the inbox table without much code change.
@DanielleMaywood DanielleMaywood changed the title bugfix: ensure targets are propagated to inbox fix: ensure targets are propagated to inbox Mar 18, 2025
@DanielleMaywood DanielleMaywood marked this pull request as ready for review March 18, 2025 16:28
@DanielleMaywood DanielleMaywood requested review from defelmnq and mtojek and removed request for defelmnq March 18, 2025 16:40
@@ -74,7 +74,7 @@ func (s *StoreEnqueuer) EnqueueWithData(ctx context.Context, userID, templateID
dispatchMethod = metadata.CustomMethod.NotificationMethod
}

payload, err := s.buildPayload(metadata, labels, data)
payload, err := s.buildPayload(metadata, labels, data, targets)
Copy link
Member

Choose a reason for hiding this comment

The 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 targets is an array of UUIDs, and that can be a combination of user UUID, template UUID, workspace UUID. Are we going to discover types of resources?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So @defelmnq's PR #16764 already updated the MessagePayload datatype to include Targets. The PR didn't fill our the Targets field though, so I'm assuming that was missed and this was the intended approach.

Copy link
Member

Choose a reason for hiding this comment

The 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 👍

Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@DanielleMaywood DanielleMaywood merged commit ef62e62 into main Mar 19, 2025
38 checks passed
@DanielleMaywood DanielleMaywood deleted the dm-bugfix-inbox-targets branch March 19, 2025 09:51
@github-actions github-actions bot locked and limited conversation to collaborators Mar 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants