fix: block auto-save when DDNS availability check is unreachable
Unit Tests / test (push) Successful in 11m34s
Unit Tests / test (push) Successful in 11m34s
'unreachable' should not be a terminal state that triggers auto-save — it was causing a 503 when the availability check failed and auto-save fired the backend registration attempt. Only 'available' allows auto-save when the cell name has changed from the loaded value. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -691,10 +691,10 @@ function Settings() {
|
||||
if (!identityDirty) return;
|
||||
if (ipRangeError || cellNameError || domainError) return;
|
||||
// In pic_ngo mode, if the cell name differs from what was last saved/loaded,
|
||||
// wait for the availability check to reach a terminal state before saving.
|
||||
// 'available' and 'unreachable' are terminal; null/'checking'/'taken' are not.
|
||||
// only auto-save once the check confirms the name is available.
|
||||
// All other states (null, 'checking', 'taken', 'unreachable') block auto-save.
|
||||
if (domainMode === 'pic_ngo' && identity.cell_name !== loadedCellName) {
|
||||
if (picAvail !== 'available' && picAvail !== 'unreachable') return;
|
||||
if (picAvail !== 'available') return;
|
||||
}
|
||||
const timer = setTimeout(() => saveIdentityRef.current(), 800);
|
||||
return () => clearTimeout(timer);
|
||||
|
||||
Reference in New Issue
Block a user