fix(subscription): prevent duplicate qb downloads

This commit is contained in:
ShukeBta
2026-06-07 10:05:49 +08:00
parent 22b64d3d47
commit d94330b30f
22 changed files with 990 additions and 75 deletions
+5 -2
View File
@@ -247,14 +247,17 @@ func TestProtectedAdminNeverViolated(t *testing.T) {
}
_ = repos.Setting.Set(ctx, SettingAntiShareEnabled, "true")
cfg := loadBotConfig(ctx, repos)
// 多次违规也不应删除/警告管理员
// 多次违规也不应删除/警告/禁用管理员
for i := 0; i < 5; i++ {
dev.registerViolation(ctx, admin.ID, "test", cfg)
dev.registerFingerprintWarning(ctx, admin.ID, "test", cfg)
}
got, _ := repos.User.FindByID(ctx, admin.ID)
if got == nil {
t.Fatal("admin must never be auto-deleted")
}
if !got.IsActive {
t.Fatal("admin must never be auto-disabled")
}
if got.ShareWarnings != 0 {
t.Fatalf("admin should accrue no warnings, got %d", got.ShareWarnings)
}