Below is a PR with changes in the session token refresh handler. After the release, complaints appeared: on abrupt connection drops, some requests still leave changes in the service, and repeated requests with the same replay token sometimes behave unstably under load.
You need to review the after version, find defects, and describe exactly what in the changes breaks the handler contract.
POST /session/refresh handler accepts JSON with fields session_id and ttl_seconds.Replay-Token header is required and is used to replay the same result only for the same logical request.Replay-Token, concurrent and repeated requests must receive the same saved result.before and compare it with after.Replay-Token;Replay-Token header is missing.Store.Replay-Token must be safe and deterministic.after, independent causes of regressions must be found, not just the symptoms listed.1.24net/http HTTP handler, no background goroutinesStore must be safe for concurrent access from multiple requestsPOST /session/refresh with JSON { "session_id": "...", "ttl_seconds": 60 }200 OK and JSON { "session_id": "...", "expires_at": "RFC3339" }400 for invalid JSON or missing Replay-Token, 499 if the context is canceled before applying the changeUse line comments to explain the problem, its impact, the fix and how to test it.