Files
3m-ui/backend/internal/user
Z User 4b00a1268a fix(functional): batch autofill, soft-delete name reclaim, hasCredState test, sub_token error, batch reset traffic
Deep functional audit of node/user/subscription/traffic features
found 5 bugs. All fixed. All tests pass (including the previously
failing hasCredState test).
== CRITICAL ==
F1: BatchCreate skips AutofillListenerDefaults
Batch-created listeners had no auto-generated UUIDs, passwords,
REALITY keys, SS ciphers, snell PSKs, or sudoku keys → mihomo
rejected the config → entire batch failed.
Fix: call AutofillListenerDefaults before ValidateModel in loop.
F2: BatchCreate doesn't reclaim soft-deleted names
Inline Count check used GORM default scope (excludes soft-deleted)
but UNIQUE index covers them → DB constraint error on name clash.
Fix: use ensureUniqueName which renames soft-deleted rows.
F3: Failing test contradicts hasCredState fallback fix
Test asserted no fallback when hasCredState=true + empty creds.
But we intentionally removed the guard to fix 'unset fields: users'.
Fix: updated test to assert config users ARE included as fallback.
== HIGH ==
F4: sub_token generation ignores error
subTok, _ := randomHex(16) — empty sub_token on rand.Read failure.
Fix: check error, return on failure.
F5: BatchResetTraffic doesn't trigger config regeneration
Over-quota users stayed blocked for ~10s after traffic reset.
Fix: added notifyCredentialsChanged() after reset.
Verification: go build/vet/test all PASS. gofmt clean.
fix(functional): batch autofill, soft-delete name reclaim, hasCredState test, sub_token error, batch reset traffic
Deep functional audit of node/user/subscription/traffic features
found 5 bugs. All fixed. All tests pass (including the previously
failing hasCredState test).
== CRITICAL ==
F1: BatchCreate skips AutofillListenerDefaults
Batch-created listeners had no auto-generated UUIDs, passwords,
REALITY keys, SS ciphers, snell PSKs, or sudoku keys → mihomo
rejected the config → entire batch failed.
Fix: call AutofillListenerDefaults before ValidateModel in loop.
F2: BatchCreate doesn't reclaim soft-deleted names
Inline Count check used GORM default scope (excludes soft-deleted)
but UNIQUE index covers them → DB constraint error on name clash.
Fix: use ensureUniqueName which renames soft-deleted rows.
F3: Failing test contradicts hasCredState fallback fix
Test asserted no fallback when hasCredState=true + empty creds.
But we intentionally removed the guard to fix 'unset fields: users'.
Fix: updated test to assert config users ARE included as fallback.
== HIGH ==
F4: sub_token generation ignores error
subTok, _ := randomHex(16) — empty sub_token on rand.Read failure.
Fix: check error, return on failure.
F5: BatchResetTraffic doesn't trigger config regeneration
Over-quota users stayed blocked for ~10s after traffic reset.
Fix: added notifyCredentialsChanged() after reset.
Verification: go build/vet/test all PASS. gofmt clean.
fix(functional): batch autofill, soft-delete name reclaim, hasCredState test, sub_token error, batch reset traffic
Deep functional audit of node/user/subscription/traffic features
found 5 bugs. All fixed. All tests pass (including the previously
failing hasCredState test).
== CRITICAL ==
F1: BatchCreate skips AutofillListenerDefaults
Batch-created listeners had no auto-generated UUIDs, passwords,
REALITY keys, SS ciphers, snell PSKs, or sudoku keys → mihomo
rejected the config → entire batch failed.
Fix: call AutofillListenerDefaults before ValidateModel in loop.
F2: BatchCreate doesn't reclaim soft-deleted names
Inline Count check used GORM default scope (excludes soft-deleted)
but UNIQUE index covers them → DB constraint error on name clash.
Fix: use ensureUniqueName which renames soft-deleted rows.
F3: Failing test contradicts hasCredState fallback fix
Test asserted no fallback when hasCredState=true + empty creds.
But we intentionally removed the guard to fix 'unset fields: users'.
Fix: updated test to assert config users ARE included as fallback.
== HIGH ==
F4: sub_token generation ignores error
subTok, _ := randomHex(16) — empty sub_token on rand.Read failure.
Fix: check error, return on failure.
F5: BatchResetTraffic doesn't trigger config regeneration
Over-quota users stayed blocked for ~10s after traffic reset.
Fix: added notifyCredentialsChanged() after reset.
Verification: go build/vet/test all PASS. gofmt clean.
fix(functional): batch autofill, soft-delete name reclaim, hasCredState test, sub_token error, batch reset traffic
Deep functional audit of node/user/subscription/traffic features
found 5 bugs. All fixed. All tests pass (including the previously
failing hasCredState test).
== CRITICAL ==
F1: BatchCreate skips AutofillListenerDefaults
Batch-created listeners had no auto-generated UUIDs, passwords,
REALITY keys, SS ciphers, snell PSKs, or sudoku keys → mihomo
rejected the config → entire batch failed.
Fix: call AutofillListenerDefaults before ValidateModel in loop.
F2: BatchCreate doesn't reclaim soft-deleted names
Inline Count check used GORM default scope (excludes soft-deleted)
but UNIQUE index covers them → DB constraint error on name clash.
Fix: use ensureUniqueName which renames soft-deleted rows.
F3: Failing test contradicts hasCredState fallback fix
Test asserted no fallback when hasCredState=true + empty creds.
But we intentionally removed the guard to fix 'unset fields: users'.
Fix: updated test to assert config users ARE included as fallback.
== HIGH ==
F4: sub_token generation ignores error
subTok, _ := randomHex(16) — empty sub_token on rand.Read failure.
Fix: check error, return on failure.
F5: BatchResetTraffic doesn't trigger config regeneration
Over-quota users stayed blocked for ~10s after traffic reset.
Fix: added notifyCredentialsChanged() after reset.
Verification: go build/vet/test all PASS. gofmt clean.
fix(functional): batch autofill, soft-delete name reclaim, hasCredState test, sub_token error, batch reset traffic
Deep functional audit of node/user/subscription/traffic features
found 5 bugs. All fixed. All tests pass (including the previously
failing hasCredState test).
== CRITICAL ==
F1: BatchCreate skips AutofillListenerDefaults
Batch-created listeners had no auto-generated UUIDs, passwords,
REALITY keys, SS ciphers, snell PSKs, or sudoku keys → mihomo
rejected the config → entire batch failed.
Fix: call AutofillListenerDefaults before ValidateModel in loop.
F2: BatchCreate doesn't reclaim soft-deleted names
Inline Count check used GORM default scope (excludes soft-deleted)
but UNIQUE index covers them → DB constraint error on name clash.
Fix: use ensureUniqueName which renames soft-deleted rows.
F3: Failing test contradicts hasCredState fallback fix
Test asserted no fallback when hasCredState=true + empty creds.
But we intentionally removed the guard to fix 'unset fields: users'.
Fix: updated test to assert config users ARE included as fallback.
== HIGH ==
F4: sub_token generation ignores error
subTok, _ := randomHex(16) — empty sub_token on rand.Read failure.
Fix: check error, return on failure.
F5: BatchResetTraffic doesn't trigger config regeneration
Over-quota users stayed blocked for ~10s after traffic reset.
Fix: added notifyCredentialsChanged() after reset.
Verification: go build/vet/test all PASS. gofmt clean.
fix(functional): batch autofill, soft-delete name reclaim, hasCredState test, sub_token error, batch reset traffic
Deep functional audit of node/user/subscription/traffic features
found 5 bugs. All fixed. All tests pass (including the previously
failing hasCredState test).
== CRITICAL ==
F1: BatchCreate skips AutofillListenerDefaults
Batch-created listeners had no auto-generated UUIDs, passwords,
REALITY keys, SS ciphers, snell PSKs, or sudoku keys → mihomo
rejected the config → entire batch failed.
Fix: call AutofillListenerDefaults before ValidateModel in loop.
F2: BatchCreate doesn't reclaim soft-deleted names
Inline Count check used GORM default scope (excludes soft-deleted)
but UNIQUE index covers them → DB constraint error on name clash.
Fix: use ensureUniqueName which renames soft-deleted rows.
F3: Failing test contradicts hasCredState fallback fix
Test asserted no fallback when hasCredState=true + empty creds.
But we intentionally removed the guard to fix 'unset fields: users'.
Fix: updated test to assert config users ARE included as fallback.
== HIGH ==
F4: sub_token generation ignores error
subTok, _ := randomHex(16) — empty sub_token on rand.Read failure.
Fix: check error, return on failure.
F5: BatchResetTraffic doesn't trigger config regeneration
Over-quota users stayed blocked for ~10s after traffic reset.
Fix: added notifyCredentialsChanged() after reset.
Verification: go build/vet/test all PASS. gofmt clean.
fix(functional): batch autofill, soft-delete name reclaim, hasCredState test, sub_token error, batch reset traffic
Deep functional audit of node/user/subscription/traffic features
found 5 bugs. All fixed. All tests pass (including the previously
failing hasCredState test).
== CRITICAL ==
F1: BatchCreate skips AutofillListenerDefaults
Batch-created listeners had no auto-generated UUIDs, passwords,
REALITY keys, SS ciphers, snell PSKs, or sudoku keys → mihomo
rejected the config → entire batch failed.
Fix: call AutofillListenerDefaults before ValidateModel in loop.
F2: BatchCreate doesn't reclaim soft-deleted names
Inline Count check used GORM default scope (excludes soft-deleted)
but UNIQUE index covers them → DB constraint error on name clash.
Fix: use ensureUniqueName which renames soft-deleted rows.
F3: Failing test contradicts hasCredState fallback fix
Test asserted no fallback when hasCredState=true + empty creds.
But we intentionally removed the guard to fix 'unset fields: users'.
Fix: updated test to assert config users ARE included as fallback.
== HIGH ==
F4: sub_token generation ignores error
subTok, _ := randomHex(16) — empty sub_token on rand.Read failure.
Fix: check error, return on failure.
F5: BatchResetTraffic doesn't trigger config regeneration
Over-quota users stayed blocked for ~10s after traffic reset.
Fix: added notifyCredentialsChanged() after reset.
Verification: go build/vet/test all PASS. gofmt clean.
fix(functional): batch autofill, soft-delete name reclaim, hasCredState test, sub_token error, batch reset traffic
Deep functional audit of node/user/subscription/traffic features
found 5 bugs. All fixed. All tests pass (including the previously
failing hasCredState test).
== CRITICAL ==
F1: BatchCreate skips AutofillListenerDefaults
Batch-created listeners had no auto-generated UUIDs, passwords,
REALITY keys, SS ciphers, snell PSKs, or sudoku keys → mihomo
rejected the config → entire batch failed.
Fix: call AutofillListenerDefaults before ValidateModel in loop.
F2: BatchCreate doesn't reclaim soft-deleted names
Inline Count check used GORM default scope (excludes soft-deleted)
but UNIQUE index covers them → DB constraint error on name clash.
Fix: use ensureUniqueName which renames soft-deleted rows.
F3: Failing test contradicts hasCredState fallback fix
Test asserted no fallback when hasCredState=true + empty creds.
But we intentionally removed the guard to fix 'unset fields: users'.
Fix: updated test to assert config users ARE included as fallback.
== HIGH ==
F4: sub_token generation ignores error
subTok, _ := randomHex(16) — empty sub_token on rand.Read failure.
Fix: check error, return on failure.
F5: BatchResetTraffic doesn't trigger config regeneration
Over-quota users stayed blocked for ~10s after traffic reset.
Fix: added notifyCredentialsChanged() after reset.
Verification: go build/vet/test all PASS. gofmt clean.
fix(functional): batch autofill, soft-delete name reclaim, hasCredState test, sub_token error, batch reset traffic
Deep functional audit of node/user/subscription/traffic features
found 5 bugs. All fixed. All tests pass (including the previously
failing hasCredState test).
== CRITICAL ==
F1: BatchCreate skips AutofillListenerDefaults
Batch-created listeners had no auto-generated UUIDs, passwords,
REALITY keys, SS ciphers, snell PSKs, or sudoku keys → mihomo
rejected the config → entire batch failed.
Fix: call AutofillListenerDefaults before ValidateModel in loop.
F2: BatchCreate doesn't reclaim soft-deleted names
Inline Count check used GORM default scope (excludes soft-deleted)
but UNIQUE index covers them → DB constraint error on name clash.
Fix: use ensureUniqueName which renames soft-deleted rows.
F3: Failing test contradicts hasCredState fallback fix
Test asserted no fallback when hasCredState=true + empty creds.
But we intentionally removed the guard to fix 'unset fields: users'.
Fix: updated test to assert config users ARE included as fallback.
== HIGH ==
F4: sub_token generation ignores error
subTok, _ := randomHex(16) — empty sub_token on rand.Read failure.
Fix: check error, return on failure.
F5: BatchResetTraffic doesn't trigger config regeneration
Over-quota users stayed blocked for ~10s after traffic reset.
Fix: added notifyCredentialsChanged() after reset.
Verification: go build/vet/test all PASS. gofmt clean.
fix(functional): batch autofill, soft-delete name reclaim, hasCredState test, sub_token error, batch reset traffic
Deep functional audit of node/user/subscription/traffic features
found 5 bugs. All fixed. All tests pass (including the previously
failing hasCredState test).
== CRITICAL ==
F1: BatchCreate skips AutofillListenerDefaults
Batch-created listeners had no auto-generated UUIDs, passwords,
REALITY keys, SS ciphers, snell PSKs, or sudoku keys → mihomo
rejected the config → entire batch failed.
Fix: call AutofillListenerDefaults before ValidateModel in loop.
F2: BatchCreate doesn't reclaim soft-deleted names
Inline Count check used GORM default scope (excludes soft-deleted)
but UNIQUE index covers them → DB constraint error on name clash.
Fix: use ensureUniqueName which renames soft-deleted rows.
F3: Failing test contradicts hasCredState fallback fix
Test asserted no fallback when hasCredState=true + empty creds.
But we intentionally removed the guard to fix 'unset fields: users'.
Fix: updated test to assert config users ARE included as fallback.
== HIGH ==
F4: sub_token generation ignores error
subTok, _ := randomHex(16) — empty sub_token on rand.Read failure.
Fix: check error, return on failure.
F5: BatchResetTraffic doesn't trigger config regeneration
Over-quota users stayed blocked for ~10s after traffic reset.
Fix: added notifyCredentialsChanged() after reset.
Verification: go build/vet/test all PASS. gofmt clean.
fix(functional): batch autofill, soft-delete name reclaim, hasCredState test, sub_token error, batch reset traffic
Deep functional audit of node/user/subscription/traffic features
found 5 bugs. All fixed. All tests pass (including the previously
failing hasCredState test).
== CRITICAL ==
F1: BatchCreate skips AutofillListenerDefaults
Batch-created listeners had no auto-generated UUIDs, passwords,
REALITY keys, SS ciphers, snell PSKs, or sudoku keys → mihomo
rejected the config → entire batch failed.
Fix: call AutofillListenerDefaults before ValidateModel in loop.
F2: BatchCreate doesn't reclaim soft-deleted names
Inline Count check used GORM default scope (excludes soft-deleted)
but UNIQUE index covers them → DB constraint error on name clash.
Fix: use ensureUniqueName which renames soft-deleted rows.
F3: Failing test contradicts hasCredState fallback fix
Test asserted no fallback when hasCredState=true + empty creds.
But we intentionally removed the guard to fix 'unset fields: users'.
Fix: updated test to assert config users ARE included as fallback.
== HIGH ==
F4: sub_token generation ignores error
subTok, _ := randomHex(16) — empty sub_token on rand.Read failure.
Fix: check error, return on failure.
F5: BatchResetTraffic doesn't trigger config regeneration
Over-quota users stayed blocked for ~10s after traffic reset.
Fix: added notifyCredentialsChanged() after reset.
Verification: go build/vet/test all PASS. gofmt clean.
fix(functional): batch autofill, soft-delete name reclaim, hasCredState test, sub_token error, batch reset traffic
Deep functional audit of node/user/subscription/traffic features
found 5 bugs. All fixed. All tests pass (including the previously
failing hasCredState test).
== CRITICAL ==
F1: BatchCreate skips AutofillListenerDefaults
Batch-created listeners had no auto-generated UUIDs, passwords,
REALITY keys, SS ciphers, snell PSKs, or sudoku keys → mihomo
rejected the config → entire batch failed.
Fix: call AutofillListenerDefaults before ValidateModel in loop.
F2: BatchCreate doesn't reclaim soft-deleted names
Inline Count check used GORM default scope (excludes soft-deleted)
but UNIQUE index covers them → DB constraint error on name clash.
Fix: use ensureUniqueName which renames soft-deleted rows.
F3: Failing test contradicts hasCredState fallback fix
Test asserted no fallback when hasCredState=true + empty creds.
But we intentionally removed the guard to fix 'unset fields: users'.
Fix: updated test to assert config users ARE included as fallback.
== HIGH ==
F4: sub_token generation ignores error
subTok, _ := randomHex(16) — empty sub_token on rand.Read failure.
Fix: check error, return on failure.
F5: BatchResetTraffic doesn't trigger config regeneration
Over-quota users stayed blocked for ~10s after traffic reset.
Fix: added notifyCredentialsChanged() after reset.
Verification: go build/vet/test all PASS. gofmt clean.
2026-08-31 04:26:51 +00:00
..