-
Notifications
You must be signed in to change notification settings - Fork 970
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: explicity set updated_at field when updating identity (#4131)
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -677,6 +677,22 @@ func TestManager(t *testing.T) { | |
// That is why we only check the identity in the store. | ||
checkExtensionFields(fromStore, "[email protected]")(t) | ||
}) | ||
|
||
t.Run("case=should always update updated_at field", func(t *testing.T) { | ||
original := identity.NewIdentity(config.DefaultIdentityTraitsSchemaID) | ||
original.Traits = newTraits("[email protected]", "") | ||
require.NoError(t, reg.IdentityManager().Create(ctx, original)) | ||
|
||
time.Sleep(time.Millisecond) | ||
|
||
require.NoError(t, reg.IdentityManager().UpdateTraits( | ||
ctx, original.ID, newTraits("[email protected]", ""), | ||
identity.ManagerAllowWriteProtectedTraits)) | ||
|
||
updated, err := reg.IdentityPool().GetIdentity(ctx, original.ID, identity.ExpandNothing) | ||
require.NoError(t, err) | ||
assert.NotEqual(t, original.UpdatedAt, updated.UpdatedAt, "UpdatedAt field should be updated") | ||
}) | ||
}) | ||
|
||
t.Run("method=RefreshAvailableAAL", func(t *testing.T) { | ||
|
This file contains 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