fix(clients): withdraw the delete tombstone when the email is re-created

Deleting a client tombstones its email for 90s so a node snapshot captured
before the deletion cannot resurrect it. Nothing withdrew that tombstone when
the operator re-created the same email, so on a master with at least one node
the next merge filtered the live client out of the snapshot and SyncInbound
pruned its inbound link. The client reappeared only once the tombstone expired,
which is the 90-120s detach window reported.

Withdraw it on a successful create, single and bulk, so a tombstone can never
outlive the identity it was meant to bury. A failed create still leaves it
standing, which is what keeps the stale-snapshot guard intact.

Closes #6370
This commit is contained in:
Sanaei
2026-09-09 00:17:54 +02:00
parent 246d9207a5
commit bc57548a35
3 changed files with 70 additions and 0 deletions
+3
View File
@@ -236,6 +236,9 @@ func (s *ClientService) Create(inboundSvc *InboundService, payload *ClientCreate
// already existed, and a create the panel reported as failed must not.
return needRestart, fanoutErr
}
// A re-created email is a live identity again: a delete tombstone left
// standing makes the next node merge prune the new client's inbound links.
withdrawClientTombstones(client.Email)
return needRestart, s.setClientLimitHwidByEmail(nil, client.Email, payload.LimitHwid)
}