diff --git a/apps/evo-world-clone/main.cpp b/apps/evo-world-clone/main.cpp index 05407c8..2f88843 100644 --- a/apps/evo-world-clone/main.cpp +++ b/apps/evo-world-clone/main.cpp @@ -486,8 +486,9 @@ int provision(const Options& o) { // operator-audited start before any genesis check, so an already provisioned region // still gets it. It only ever advances, so one below the start is a conflict. if (o.life_allocator_start) { + const auto start = *o.life_allocator_start; const std::array p{std::to_string(o.source.key.world), - std::to_string(*o.life_allocator_start)}; + std::to_string(start)}; const std::array world{p[0]}; auto rows = db->query("INSERT INTO evolution.life_allocators(world_id, next_identity) " "VALUES ($1::evolution.u64, $2::evolution.u64) " @@ -497,14 +498,17 @@ int provision(const Options& o) { rows = db->query("SELECT next_identity FROM evolution.life_allocators " "WHERE world_id = $1::evolution.u64", world, timeout); - const auto next = rows && rows->size() == 1 && (*rows)[0].size() == 1 && (*rows)[0][0] - ? number(*(*rows)[0][0]) - : std::nullopt; + std::optional next; + if (rows && rows->size() == 1 && (*rows)[0].size() == 1) { + const auto& cell = (*rows)[0][0]; + if (cell.has_value()) + next = number(*cell); + } if (!next) { std::puts("life-allocator refused"); return 3; } - if (*next < *o.life_allocator_start) { + if (*next < start) { std::puts("life-allocator refused existing below start"); return 4; } diff --git a/deploy/kubernetes/region/dev-session-route/listener.yaml b/deploy/kubernetes/region/dev-session-route/listener.yaml index 9304121..df66b3a 100644 --- a/deploy/kubernetes/region/dev-session-route/listener.yaml +++ b/deploy/kubernetes/region/dev-session-route/listener.yaml @@ -12,7 +12,7 @@ spec: env: - {name: REGION_SESSION, value: "dev"} - {name: REGION_SESSION_LISTEN, value: "0.0.0.0:7400"} - - {name: REGION_SESSION_WINDOW, value: "dev-20261013T153015-33322:1791916215"} + - {name: REGION_SESSION_WINDOW, value: "dev-20261013T155433-14816:1791917673"} - {name: REGION_M10_MAX_GRANT_LIFETIME, value: "14400"} ports: # QUIC (ADR-0090): UDP only; nothing listens on TCP 7400. diff --git a/tests/region_store_tests.cpp b/tests/region_store_tests.cpp index bc02ec3..cdc5ff5 100644 --- a/tests/region_store_tests.cpp +++ b/tests/region_store_tests.cpp @@ -408,7 +408,9 @@ void provisioning_creates_the_life_allocator_once() { auto db = owner(); auto rows = db->query( "SELECT next_identity FROM evolution.life_allocators WHERE world_id = 9760", {}, 5s); - return rows && rows->size() == 1 && (*rows)[0][0] ? *(*rows)[0][0] : std::string{}; + if (!rows || rows->size() != 1 || (*rows)[0].size() != 1) + return std::string{}; + return (*rows)[0][0].value_or(std::string{}); }; int code = -1; const auto development = run("development-v1", 5000, code);