mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
test(auth): cover stale active error metadata path
Refine the recovered-account regression test to match the real observed state: an account can remain active while still carrying stale refresh-failure metadata. This verifies that getProviderCredentials surfaces those fields and that clearAccountError clears them through the real runtime path.
This commit is contained in:
@@ -32,16 +32,20 @@ test("clearAccountError clears stale provider error metadata after recovery", as
|
||||
email: "recover@example.com",
|
||||
accessToken: "access",
|
||||
refreshToken: "refresh",
|
||||
testStatus: "error",
|
||||
lastError: "Health check: token refresh failed",
|
||||
testStatus: "active",
|
||||
lastError: null,
|
||||
lastErrorType: "token_refresh_failed",
|
||||
lastErrorSource: "oauth",
|
||||
errorCode: "refresh_failed",
|
||||
rateLimitedUntil: new Date(Date.now() + 60_000).toISOString(),
|
||||
rateLimitedUntil: null,
|
||||
backoffLevel: 2,
|
||||
});
|
||||
|
||||
const credentials = await auth.getProviderCredentials("codex");
|
||||
assert.equal(credentials.connectionId, created.id);
|
||||
assert.equal(credentials.errorCode, "refresh_failed");
|
||||
assert.equal(credentials.lastErrorType, "token_refresh_failed");
|
||||
assert.equal(credentials.lastErrorSource, "oauth");
|
||||
await auth.clearAccountError(created.id, credentials);
|
||||
|
||||
const updated = await providersDb.getProviderConnectionById(created.id);
|
||||
|
||||
Reference in New Issue
Block a user