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
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:
@@ -1,5 +1,6 @@
|
||||
#include "evo/client/region_session.hpp"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <utility>
|
||||
|
||||
namespace evo::client {
|
||||
@@ -41,13 +42,21 @@ struct RegionSessionClient::Impl {
|
||||
void seen_tick(std::uint64_t tick) {
|
||||
server_tick = std::max(server_tick, tick);
|
||||
}
|
||||
// A protocol close names its cause on stderr: which channel, the codec or assembly
|
||||
// error, or the message alternative and version that was not expected here.
|
||||
void protocol_close(const char* where, int detail, std::size_t bytes) {
|
||||
std::fprintf(stderr, "session protocol close: %s detail=%d bytes=%zu state=%d\n", where,
|
||||
detail, bytes, static_cast<int>(state));
|
||||
end(SessionCloseReason::protocol, true);
|
||||
}
|
||||
// Datagrams: receipts and watermarks only, after Welcome.
|
||||
void datagram(std::span<const std::uint8_t> bytes) {
|
||||
if (state != RegionSessionState::established)
|
||||
return;
|
||||
const auto decoded = network::decode_session(bytes);
|
||||
if (!decoded)
|
||||
return end(SessionCloseReason::protocol, true);
|
||||
return protocol_close("datagram decode", static_cast<int>(decoded.error()),
|
||||
bytes.size());
|
||||
if (const auto* m = std::get_if<network::IntentionReceipt>(&*decoded)) {
|
||||
seen_tick(m->server_tick);
|
||||
return keep(intention_receipts, *m);
|
||||
@@ -59,8 +68,8 @@ struct RegionSessionClient::Impl {
|
||||
if (!snapshots)
|
||||
return; // Before Welcome (channels are not ordered): the next tick resends.
|
||||
const auto accepted = snapshots->accept(*m);
|
||||
if (!accepted)
|
||||
return end(SessionCloseReason::protocol, true); // Malformed snapshot.
|
||||
if (!accepted) // Malformed snapshot.
|
||||
return protocol_close("snapshot", static_cast<int>(accepted.error()), bytes.size());
|
||||
if (const auto ack = accepted.value_or(std::nullopt); ack && connection != 0)
|
||||
// A lost ack only means the next delta is against an older baseline.
|
||||
(void)endpoint
|
||||
@@ -76,7 +85,7 @@ struct RegionSessionClient::Impl {
|
||||
simulated = *m;
|
||||
return;
|
||||
}
|
||||
end(SessionCloseReason::protocol, true);
|
||||
protocol_close("datagram unexpected", static_cast<int>(decoded->index()), bytes.size());
|
||||
}
|
||||
|
||||
bool send(const network::SessionMessage& m) {
|
||||
@@ -100,7 +109,8 @@ struct RegionSessionClient::Impl {
|
||||
std::uint16_t wire_version{};
|
||||
const auto decoded = network::decode_session(bytes, &wire_version);
|
||||
if (!decoded)
|
||||
return end(SessionCloseReason::protocol, true);
|
||||
return protocol_close("message decode", static_cast<int>(decoded.error()),
|
||||
bytes.size());
|
||||
if (wire_version != protocol_version)
|
||||
return end(SessionCloseReason::unsupported_version, true);
|
||||
if (const auto* m = std::get_if<network::SessionClose>(&*decoded))
|
||||
@@ -146,7 +156,8 @@ struct RegionSessionClient::Impl {
|
||||
return;
|
||||
}
|
||||
}
|
||||
end(SessionCloseReason::protocol, true);
|
||||
protocol_close("message unexpected",
|
||||
static_cast<int>(decoded->index()) * 100 + wire_version, bytes.size());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user