fix(cellular): one action per account a tick, never a refused tick
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (checks) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / postgres-tools (push) Successful in 1m39s
Foundation / server-image (push) Successful in 5m19s
Foundation / image (push) Successful in 6m54s

Region 16 playtest: a bud showed and was then undone, and several buds were
refused. The client scheduled a discrete action at server tick + lead, but
movement runs ahead of that once the lead shrinks (each movement takes the
tick after the last one sent), so a bud could name a tick a movement already
had. A tick takes one action per account: the region refused the whole tick
and dropped every player's actions on it ("tick stalled ... error=4").

- Server: keep_one_action_per_account keeps each account's discrete action
  (engulf, bud, become, emerge), else its newest, and refuses only the rest.
- Client: a discrete action is scheduled after every tick already sent, and
  movement is held off the tick a queued discrete action owns.
- Failed background commits now log their category, publication error,
  store error and SQLSTATE (never server text), to diagnose ok=0 commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-29 08:31:16 -04:00
co-authored by Claude Opus 5.5
parent 2ce8c3afb1
commit 9de55e352d
6 changed files with 90 additions and 4 deletions
+18
View File
@@ -174,6 +174,24 @@ void actions_bind_to_owned_life_and_preserve_other_inputs() {
const std::array duplicate{action, action};
CHECK(prepare_cellular_session_tick(**state, 2, baseline, duplicate).error() ==
CellularSessionBatchError::duplicate_action);
// Two actions of one account on one tick: the discrete one is kept, even when older,
// so the tick is not refused for every player; between movements the newest is kept.
{
const network::CarriedAction bud{network::AccountId{controlled.account}, 80, 2,
network::ActionKind::cellular, bud_input};
auto later = action;
later.action_id = 90;
std::vector<network::CarriedAction> both{bud, later};
const auto superseded = keep_one_action_per_account(both);
CHECK(both.size() == 1 && both[0] == bud && superseded.size() == 1 &&
superseded[0] == later);
CHECK(prepare_cellular_session_tick(**state, 2, baseline, both));
std::vector<network::CarriedAction> moves{action, later};
CHECK(keep_one_action_per_account(moves) == std::vector{action} && moves.size() == 1 &&
moves[0] == later);
std::vector<network::CarriedAction> single{action};
CHECK(keep_one_action_per_account(single).empty() && single.size() == 1);
}
auto unknown = action;
unknown.account.bytes.back() = 3;
const std::array unknown_actions{unknown};