Skip to content

fix(homegrown): close post-merge soft-hold races (TIN-2764) - #119

Merged
Jesssullivan merged 1 commit into
mainfrom
fix/tin-2764-post-merge-hold-safety
Jul 11, 2026
Merged

fix(homegrown): close post-merge soft-hold races (TIN-2764)#119
Jesssullivan merged 1 commit into
mainfrom
fix/tin-2764-post-merge-hold-safety

Conversation

@Jesssullivan

Copy link
Copy Markdown
Owner

Context

PR #118 merged before its adversarial review corrections were committed. This follow-up lands the confirmed post-merge safety fixes without rewriting the merged history.

Changes

  • make Homegrown soft-hold acquisition use the same practitioner-day transaction lock and occupied-set revalidation as booking writes
  • derive conflict query days from the buffer-expanded interval and iterate local calendar-day lock keys across DST transitions
  • query active holds by interval overlap, and exclude only the exact hold id + datetime + duration capability
  • propagate SLOT_TAKEN before payment while stripping any caller-supplied hold id from the standard checkout pipeline
  • start hold TTL after lock contention and the final availability check
  • add unit coverage plus a real-Postgres race where exactly one of two concurrent holds wins
  • update the parity matrix to reflect Homegrown atomicity and the bridge-only advisory fallback

Review and validation

  • initial adversarial review found the post-lock TTL issue; fixed with a regression test
  • final independent Codex review: PASS
  • pnpm check: 0 errors, 0 warnings
  • pnpm lint
  • pnpm test:unit: 876 passed
  • pnpm test:integration: 34 passed, 5 Postgres tests skipped locally without DATABASE_URL
  • pnpm build
  • pnpm check:package: publint all good
  • nix develop --command pnpm docs:check: strict MkDocs build passed
  • git diff --check

Merge gate

The CI Integration (Postgres service) job must run the five database tests, including the new concurrent-hold case, and pass before merge.

Tracks TIN-2764.

@Jesssullivan
Jesssullivan merged commit 80246f3 into main Jul 11, 2026
6 checks passed
@Jesssullivan
Jesssullivan deleted the fix/tin-2764-post-merge-hold-safety branch July 11, 2026 13:12
Jesssullivan added a commit that referenced this pull request Jul 13, 2026
Ships the TIN-2764 sprint-1 concurrency fixes (#118, #119): write-time slot validation, practitioner and local-day advisory locks, soft-hold admission gating, real-Postgres concurrency suite. New typed SLOT_TAKEN failure is behavior-changing for consumers; see release notes.
Jesssullivan added a commit that referenced this pull request Jul 13, 2026
v0.11.0 missed the BUILD.bazel npm_package version attr (check-release-metadata caught it in CI). v0.11.1 aligns package.json, MODULE.bazel, and BUILD.bazel at 0.11.1. Content is otherwise identical to v0.11.0 (the TIN-2764 sprint-1 fixes from #118 and #119).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant