Merge pull request #2133 from DragonFSKY/fix/2061-stale-modelstates

fix(auth): prevent stale runtime state inheritance from disabled auth entries
This commit is contained in:
Luis Pater
2026-03-28 20:50:57 +08:00
committed by GitHub
4 changed files with 250 additions and 6 deletions
+4 -2
View File
@@ -923,8 +923,10 @@ func (m *Manager) Update(ctx context.Context, auth *Auth) (*Auth, error) {
auth.Index = existing.Index
auth.indexAssigned = existing.indexAssigned
}
if len(auth.ModelStates) == 0 && len(existing.ModelStates) > 0 {
auth.ModelStates = existing.ModelStates
if !existing.Disabled && existing.Status != StatusDisabled && !auth.Disabled && auth.Status != StatusDisabled {
if len(auth.ModelStates) == 0 && len(existing.ModelStates) > 0 {
auth.ModelStates = existing.ModelStates
}
}
}
auth.EnsureIndex()