Repository navigation
feat(carrier): merchant can cancel an unaccepted marketplace booking - #164
Merged
Merged
Conversation
…r has not accepted POST /v1/marketplace/bookings/:id/cancel (marketplace:book). Void-then-cancel is now one shared path used by the expiry sweep and the merchant cancel; a failed void leaves the booking Pending. Someone else's booking is a 404 identical to a missing one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ands after cancel accept, reject, expiry and merchant cancel now write through transition_booking (UPDATE ... WHERE status and payment_status still match), so racing writers cannot both win; a lost race is BusinessRule (expiry: skip), not a 500. handle_authorized voids a hold that lands on a booking no longer pending instead of marking it authorized. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lease if it keeps failing The booking-payment consumer commits every message, so a failed void was never redelivered. The late-hold void now makes 3 attempts (0, 200 ms, 1 s) and, if all fail, logs at error with booking_id, tenant_id and intent_id and a MANUAL RELEASE REQUIRED marker. Stale "retry costs nothing" comments corrected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lost compare-and-set after a successful void re-read the booking and voided the same intent again, raising a false MANUAL RELEASE alarm. The void is now carried across CAS passes; if the void succeeded but the record never lands, log "RECONCILE BOOKING" and return Err instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d-arm error The consumer commits unconditionally, so an error outside the late-hold void was logged without ids and the hold silently stranded. handle_authorized now wraps every error with booking_id, intent_id and logs a "hold may be stranded - MANUAL RELEASE / RECONCILE" marker, CAS give-up included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nflict, not a 500 After a void error, re-read the booking (tenant-scoped); if it left Pending the carrier won the race, so return CONFLICT_MESSAGE instead of an internal error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI installs stable Rust, which is now 1.100.0 (2026-11-09). Its type- inference change (rust-lang/rust#148922) stops redis 0.25.4 compiling (`!: FromRedisValue`), so "cargo check", "Lint" and every test job behind it fail on master and every open PR, with no code change. Lockfile-only, all in-range (no Cargo.toml change): - redis 0.25.4 -> 0.25.5 (the never-type fallback fix) - RustSec patched releases: ctutils 0.4.8, quinn-proto 0.11.19, quinn-udp 0.5.16, rustls 0.23.46, rustls-webpki 0.103.17, webpki-roots 1.0.12, rustix 1.1.6, tokio 1.54.1, url 2.5.9, aws-smithy-* (in range) Verified locally on rustc 1.100.0: cargo check --workspace --all-targets and CI's clippy command (-D warnings -D clippy::all) both pass. Not cleared (no in-range fix; needs a decision, so no ignore is added): crypto-bigint 0.5.5 via aws-sigv4 (RUSTSEC-2026-0387), libsqlite3-sys 0.30.1 in the lockfile but not built (RUSTSEC-2026-0459), unmaintained chrono / chrono-tz / chrono-tz-build / pin-utils. rmcp (3 advisories) needs a ServerInfo -> ServerConfig rename in ai-layer, so it lands with the MCP PR, not here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rmcp 3.0.1 has three advisories (RUSTSEC-2026-0461 unbounded tool schema cache in the Streamable HTTP server transport, which is the transport /mcp serves; -0462 unbounded response buffering in Streamable HTTP clients; -0457 OAuth client SSRF filter). The patched floor is 3.9.0, so the workspace requirement is raised to 3.9.0 and the lock takes 3.12.0. 3.9+ deprecates `model::ServerInfo` in favour of `ServerConfig` (same type), which fails CI's -D warnings, so the handler uses the new name. Verified on rustc 1.100.0: clippy -p logisticos-ai-layer --all-targets -D warnings -D clippy::all clean; cargo test -p logisticos-ai-layer 107 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reasons The 2026-11 advisory-db refresh left six findings that no in-range upgrade clears. Each is added to all three places that must agree (ci-rust.yml --ignore flags, deny.toml, scripts/check-audit-ignores.sh) with its reason and an expiry check the guard re-runs on every CI build: - RUSTSEC-2026-0387 crypto-bigint 0.5.5: compiled only via aws-sigv4's sigv4a (S3 multi-region access point signing), never called; fix is 0.7.6 and aws-sigv4 1.x pins 0.5. Guard walks the chain crypto-bigint <- elliptic-curve/ecdsa/primeorder <- p256 <- aws-sigv4 and fails if any link gains another consumer. - RUSTSEC-2026-0459 libsqlite3-sys: never compiled (sqlx-sqlite optional dep, Postgres-only). Guard fails if it enters the build graph. - RUSTSEC-2026-0543 chrono, -0555 chrono-tz, -0559 chrono-tz-build, -0441 pin-utils: unmaintained, informational, no fixed version. Guard fails once they stop being reported. Verified locally: cargo audit with CI's flags, the guard script and cargo deny check (advisories) all pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
breakdisk
pushed a commit
that referenced
this pull request
Nov 27, 2026
- carrier: #164 added MarketplaceRepository::transition_booking. #171's admin route test double predates it, so the lib tests stopped compiling. Give the double the same compare-and-set as the service tests' double. - order-intake: #173 wired tests/unit into Cargo, and its Shipment fixture predates #163's sla_due_at field. Add it as None. Checked locally on rustc 1.100: workspace clippy --all-targets -D warnings, the unwrap_used gate, the /health and OpenAPI route checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A merchant can cancel a marketplace booking the carrier has not accepted yet, without stranding a card hold.
Pending(expire, merchant cancel, accept) is a compare-and-set:UPDATE ... WHERE id AND tenant_id AND status='pending'. Zero rows means a conflict (BusinessRule), not a 500.Pendingis voided instead of attached. The void is retried 3 times; on final failure it logs aterrorwithbooking_id,intent_idand aMANUAL RELEASEmarker.Merge note
services/carrier/src/api/http/mod.rstextually conflicts withfeat/portals/marketplace-real-backend(both add routes). Keep both sets of routes.Known follow-ups
Pending.MANUAL RELEASEand "hold may be stranded" log lines.Test plan
Part of the "wire the platform gaps" plan (
docs/platform/gap-plans). Each task passed a task review; the branch passed a whole-branch final review and one fix wave with a scoped re-review.🤖 Generated with Claude Code