fix(monitor): 超级编导密码错了就别再自动重试,免得锁号
Deploy VitePress site to Pages / build (push) Canceled after 0s
Deploy VitePress site to Pages / Deploy (push) Canceled after 0s

超级编导对密码尝试有次数限制(实测提示今日剩余 4 次)。自动追加失败后每
30 分钟重试一次,密码错的话当天就能把账号锁掉。1002/10006/4026 这类凭据
错误改成 30 天后再试;设置页保存新凭据会把调度钟拨回现在,不会卡住。
This commit is contained in:
2026-10-25 11:10:45 +08:00
parent b05491e9de
commit cd2a276630
3 changed files with 34 additions and 2 deletions
+19
View File
@@ -312,6 +312,25 @@ class TestActivityPaging:
await superdir._fetch_activities("token", None)
class TestRetryBackoff:
def test_a_wrong_password_stops_the_auto_retry_loop(self):
"""密码错一次就退到「等人来修」——账号有尝试次数限制,自动重试会把号锁掉。"""
error = superdir._error({"code": 1002, "message": "登录密码错误"})
assert superdir.retry_delay_ms(error) == superdir.CREDENTIAL_RETRY_DISABLED_MS
def test_an_ordinary_failure_retries_soon(self):
error = superdir.SuperDirError(500, "服务端错误")
assert superdir.retry_delay_ms(error) == superdir.SYNC_FAILURE_RETRY_MS
def test_a_missing_token_is_not_a_credential_error(self):
"""没配凭据不会去登录,所以不算「密码错」,按普通间隔重试即可。"""
error = superdir.SuperDirError("", "没有配置账号密码")
assert superdir.retry_delay_ms(error) == superdir.SYNC_FAILURE_RETRY_MS
class TestErrorHints:
def test_a_relogin_error_explains_itself(self):
error = superdir._error({"code": 4017, "message": "账号已在别处登录"})