Handle stale configuration sync events when local row is missing
This commit is contained in:
@@ -637,6 +637,10 @@ func (s *Service) resolveConfigurationPayloadForPush(change *localdb.PendingChan
|
||||
|
||||
currentCfg, currentVersionID, currentVersionNo, err := s.loadCurrentConfigurationState(payload.ConfigurationUUID)
|
||||
if err != nil {
|
||||
// Local config may be gone (e.g. stale queue item after delete/cleanup). Treat as no-op.
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return payload, payload.Snapshot, true, nil
|
||||
}
|
||||
// create->deactivate race: config may no longer be active/visible locally, skip stale create.
|
||||
if change.Operation == "create" {
|
||||
return payload, payload.Snapshot, true, nil
|
||||
|
||||
Reference in New Issue
Block a user