**test(auth): add test for preserving ModelStates during auth updates**
This commit is contained in:
Luis Pater
2026-03-04 02:06:24 +08:00
parent 9f95b31158
commit 79009bb3d4
3 changed files with 60 additions and 3 deletions
+3
View File
@@ -290,6 +290,9 @@ func (s *Service) applyCoreAuthAddOrUpdate(ctx context.Context, auth *coreauth.A
auth.CreatedAt = existing.CreatedAt
auth.LastRefreshedAt = existing.LastRefreshedAt
auth.NextRefreshAfter = existing.NextRefreshAfter
if len(auth.ModelStates) == 0 && len(existing.ModelStates) > 0 {
auth.ModelStates = existing.ModelStates
}
op = "update"
_, err = s.coreManager.Update(ctx, auth)
} else {