fix(providers): accept numeric expires_at in OAuth status (#1407)

This commit is contained in:
m57 authored and GitHub committed 2026-09-30 13:30:41 +03:00
1 parent 6810ef02fe
commit 48de25985a
2 files changed
+61 -3

No files matched your search

@@ -598,6 +598,27 @@ class HermesApiServiceMockWebServerTest {
assertEquals(404, response.code())
}
@Test
fun getOAuthProviders_toleratesNumericExpiresAt() =
runBlocking {
mockServer.enqueue(
MockResponse()
.setResponseCode(200)
.setBody(
"""
{"providers":[{"id":"codex","name":"Codex","flow":"external",
"status":{"logged_in":true,"expires_at":1790766533634,"last_refresh":1790766000000}}]}
""".trimIndent(),
),
)
val response = api.getOAuthProviders()
assertTrue(response.isSuccessful)
val status = response.body()!!.providers[0].status
assertEquals("1790766533634", status.expiresAt)
assertEquals("1790766000000", status.lastRefresh)
}
@Test
fun getOAuthProviders_parsesList() =
runBlocking {