Make session refresh retries idempotent
CI / verify (push) Has been cancelled
CI / publish (push) Has been cancelled

Preserve the successor session for legitimate refresh retries so transient failures no longer revoke the user's session family.
This commit is contained in:
Rocky
2026-08-25 13:13:41 +08:00
parent 36a926f12f
commit 4c9e5feec0
14 changed files with 409 additions and 65 deletions
@@ -20,6 +20,24 @@ class DeploymentConsistencyTest : FunSpec({
documentedPaths shouldBe EXPECTED_PUBLIC_PATHS
}
test("session refresh idempotency stays aligned across API, schema, and deployment") {
val openApi = root.read("docs/openapi.yaml")
val migration = root.read(
"src/main/resources/db/migration/V29__idempotent_session_refresh.sql",
)
openApi shouldContain "refreshOperationId"
migration shouldContain "encrypted_replacement_refresh_token"
migration shouldContain "refresh_replay_until"
listOf(
root.read("src/main/resources/application.yaml"),
root.read(".env.example"),
root.read("compose.yaml"),
).forEach { configuration ->
configuration shouldContain "LEGACY_REFRESH_REPLAY_SECONDS"
}
}
test("OpenAPI defines admin pagination and response contracts") {
val openApi = root.read("docs/openapi.yaml")
val sessionSchema = openApi