From 16d8a9d098a90074d7038eb8e82587245be26424 Mon Sep 17 00:00:00 2001 From: dingo Date: Sun, 11 Oct 2026 12:33:03 -0400 Subject: [PATCH] Avoid unchecked optional in mutation reservation load --- docs/engineering/VALIDATION.md | 7 +++++++ src/persistence/region_lease_store.cpp | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/engineering/VALIDATION.md b/docs/engineering/VALIDATION.md index 500e411..2d4bc88 100644 --- a/docs/engineering/VALIDATION.md +++ b/docs/engineering/VALIDATION.md @@ -6920,3 +6920,10 @@ access in the cellular profile-migration recovery check at optional migration record through `value_or` and validates the copy after preserving the missing-record history failure. PostgreSQL failed on this diagnostic, so the image and Harbor jobs remained blocked. + +CI run #291 confirmed the migration-recovery repair and found another unchecked +optional in the PostgreSQL reservation-row decoder at +`src/persistence/region_lease_store.cpp:1322`. The decoder now passes a safe +empty-string default to the hex parser; absent or malformed input still fails +the existing validation path. The PostgreSQL job failed on this diagnostic, so +the dependent server-image and Harbor jobs did not start. diff --git a/src/persistence/region_lease_store.cpp b/src/persistence/region_lease_store.cpp index 29e3449..65b2936 100644 --- a/src/persistence/region_lease_store.cpp +++ b/src/persistence/region_lease_store.cpp @@ -1318,8 +1318,8 @@ load_pending_cellular_mutations(Postgres& db, RegionKey key, const LeaseGrant& l const auto generation = parse_integer(row[2]); const auto target_tick = parse_integer(row[3]); const auto successor = parse_integer(row[4]); - const auto input = - row[5] ? unhex(*row[5]) : std::nullopt; + const auto input_hex = row[5].value_or(std::string{}); + const auto input = unhex(input_hex); if (!account || *account == Uuid{} || !action || *action == 0 || !generation || *generation == 0 || !target_tick || *target_tick == 0 || !successor || *successor == 0 || !input || little(*input, 0, 8) != *target_tick ||