cleanup after reregistering channel phone number
context
- sometimes when a channel's keystore becomes corrupted (due to upstream concurrency issues w/ signald), we reregister the phone number in order to rebuild the keystore from scratch (which gets the channel back in working order but changes its safety number)
- this works for restoring the channel but has 2 unfortuate side effects:
- (1) it leaves the phone number listed as
VERIFIED
when in fact it should beACTIVE
. as such it could mistakenly used to create a new channel - (2) it causes the diagnostics channel to have an untrusted safety number with the channel and thus always fail to send health check messages to it
- (1) it leaves the phone number listed as
- the point if this ticket is to fix those bugs!
behavior
- WHEN
registrar.register
has finished its core business logic, check to see if the phone number is in use for a channel and if so.. - THEN set the phone number's status to
ACTIVE
- AND then trust the safety number between the diagnostics channel and the phone number that was just registered
Edited by aguestuser