fix(notification): correct ID order of the invite code sent handler (#12846)

(cherry picked from commit 72bbb01fd6)
(cherry picked from commit 101343ad87)
This commit is contained in:
Livio Spring committed 2026-10-01 10:45:46 +02:00
1 parent 3b10ac1e2d
commit 319d033199
4 files changed
+7 -7

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ type Commands interface {
HumanPasswordlessInitCodeSent(ctx context.Context, userID, resourceOwner, codeID string) error
PasswordChangeSent(ctx context.Context, orgID, userID string) error
HumanPhoneVerificationCodeSent(ctx context.Context, orgID, userID string, generatorInfo *senders.CodeGeneratorInfo) error
InviteCodeSent(ctx context.Context, orgID, userID string) error
InviteCodeSent(ctx context.Context, userID, orgID string) error
UsageNotificationSent(ctx context.Context, dueEvent *quota.NotificationDueEvent) error
MilestonePushed(ctx context.Context, instanceID string, msType milestone.Type, endpoints []string) error
BackChannelLogoutSent(ctx context.Context, id, oidcSessionID, instanceID string) (err error)
@@ -142,17 +142,17 @@ func (mr *MockCommandsMockRecorder) HumanPhoneVerificationCodeSent(ctx, orgID, u
}
// InviteCodeSent mocks base method.
func (m *MockCommands) InviteCodeSent(ctx context.Context, orgID, userID string) error {
func (m *MockCommands) InviteCodeSent(ctx context.Context, userID, orgID string) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "InviteCodeSent", ctx, orgID, userID)
ret := m.ctrl.Call(m, "InviteCodeSent", ctx, userID, orgID)
ret0, _ := ret[0].(error)
return ret0
}
// InviteCodeSent indicates an expected call of InviteCodeSent.
func (mr *MockCommandsMockRecorder) InviteCodeSent(ctx, orgID, userID any) *gomock.Call {
func (mr *MockCommandsMockRecorder) InviteCodeSent(ctx, userID, orgID any) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InviteCodeSent", reflect.TypeOf((*MockCommands)(nil).InviteCodeSent), ctx, orgID, userID)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InviteCodeSent", reflect.TypeOf((*MockCommands)(nil).InviteCodeSent), ctx, userID, orgID)
}
// MilestonePushed mocks base method.
@@ -108,7 +108,7 @@ func Test_userNotifier_reduceNotificationRequested(t *testing.T) {
}
codeAlg, code := cryptoValue(t, ctrl, "testcode")
expectTemplateWithNotifyUserQueries(queries, givenTemplate)
commands.EXPECT().InviteCodeSent(gomock.Any(), orgID, userID).Return(nil)
commands.EXPECT().InviteCodeSent(gomock.Any(), userID, orgID).Return(nil)
return fieldsWorker{
queries: queries,
commands: commands,
@@ -79,7 +79,7 @@ func init() {
)
RegisterSentHandler(user.HumanInviteCodeAddedType,
func(ctx context.Context, commands Commands, id, orgID string, _ *senders.CodeGeneratorInfo, args map[string]any) error {
return commands.InviteCodeSent(ctx, orgID, id)
return commands.InviteCodeSent(ctx, id, orgID)
},
)
}