Send a life identity on the wire only with a born outcome
Foundation / checks (checks) (push) Successful in 40m57s
Foundation / checks (deploy) (push) Successful in 3m59s
Foundation / checks (ecs) (push) Successful in 2m19s
Foundation / checks (network) (push) Successful in 19m0s
Foundation / checks (postgres) (push) Successful in 43m16s
Foundation / checks (tsan) (push) Successful in 9m41s
Foundation / checks (client) (push) Successful in 13m43s
Foundation / postgres-tools (push) Successful in 18s
Foundation / server-image (push) Successful in 3m0s
Foundation / image (push) Successful in 3m15s

A fresh client launch sends a new birth request. For an account that
already has a cell, the cellular host reports existing_life with the
reserved identity, and RegionSessions forwarded it although the codec
accepts an identity only with born. The client closed with protocol and
retried with the next grant until the account was rate-limited, so no
account with a cell could log in from a new launch. Clear the identity
and commit on every other result at the session boundary, and test that
an existing_life refusal arrives valid while the session stays open.

The client now names the cause of a protocol close on stderr, which is
how this was found. Record it in ADR-0123. Also refresh the dev session
window (3 h).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-13 16:51:09 -04:00
co-authored by Claude Opus 5.5
parent f3aecaf36a
commit e9b010ed01
6 changed files with 68 additions and 11 deletions
+15 -2
View File
@@ -10,6 +10,17 @@ using network::SessionCloseReason;
using network::SessionGrantError;
using Clock = std::chrono::steady_clock;
// The wire outcome names a life only once it is born; the codec refuses an identity or
// commit on any other result. A host may report a pending or refused request's reserved
// identity, which stays server-side.
network::PrimitiveLifeOutcome wire_outcome(network::PrimitiveLifeOutcome outcome) {
if (outcome.result != network::PrimitiveLifeResult::born) {
outcome.life_identity = 0;
outcome.commit_sequence = 0;
}
return outcome;
}
SessionCloseReason reason_for(ControlError e) {
switch (e) {
case ControlError::wrong_environment:
@@ -651,14 +662,16 @@ struct RegionSessions::Impl {
: network::AdmitStatus::admitted;
send(c, network::PrimitiveLifeReceipt{m->request_id, status, facts.simulated_tick});
if (status == network::AdmitStatus::admitted)
send(c, config.create_primitive_life(c.account_id, c.generation, m->request_id));
send(c, wire_outcome(config.create_primitive_life(c.account_id, c.generation,
m->request_id)));
return;
}
if (const auto* m = std::get_if<network::PrimitiveLifeQuery>(&*decoded)) {
if (c.generation == 0)
return send(c, network::PrimitiveLifeOutcome{
m->request_id, network::PrimitiveLifeResult::unknown, 0, 0});
return send(c, config.query_primitive_life(c.account_id, c.generation, m->request_id));
return send(c, wire_outcome(config.query_primitive_life(c.account_id, c.generation,
m->request_id)));
}
close(c, SessionCloseReason::protocol, now);
}