Skip to content

docs: correct outbox claim timing back to in-transaction#73

Merged
patrickleet merged 1 commit into
mainfrom
fix/outbox-claim-timing-docs
Jun 6, 2026
Merged

docs: correct outbox claim timing back to in-transaction#73
patrickleet merged 1 commit into
mainfrom
fix/outbox-claim-timing-docs

Conversation

@patrickleet
Copy link
Copy Markdown
Collaborator

@patrickleet patrickleet commented Jun 6, 2026

Summary

Reverts a doc-wording change from the PR #53 review (commit 6885393) that was based on a misread of the code paths.

The review comment pointed at OutboxDispatcher::dispatch_ids (which claims rows post-commit via claim_async) and concluded the README's "claims the row in the commit transaction" wording was wrong. But dispatch_ids is used only by tests/transport_conformance/ — never by Service::with_bus.

The actual with_bus immediate-publish path is AggregateCommit::commit (src/outbox/commit.rs):

  1. claim_at(...) mutates each outbox message to InFlight under a short lease (commit.rs:161)
  2. ...before commit_batch persists those rows in the transaction (commit.rs:173)
  3. publish_claimed(...) publishes immediately after commit (commit.rs:187)

So rows are genuinely born InFlight in the commit transaction. The original wording was correct; this restores it in the README and the with_bus doc comment. Code behavior is unchanged — docs only.

Test output

cargo build --lib clean (doc-comment + README only).

Summary by CodeRabbit

  • Documentation
    • Updated Outbox Pattern documentation to clarify the publishing sequence following transaction commits, including how entries are claimed under a short lease for immediate publishing and improved descriptions of lease management and crash recovery mechanisms.

The PR #53 review (6885393) reworded the with_bus outbox path to say the row is
claimed *post-commit*. That described OutboxDispatcher::dispatch_ids — a separate
primitive used only by transport conformance tests. The actual with_bus path
(AggregateCommit::commit) claims each row in the commit transaction via claim_at
before commit_batch writes it (born InFlight under a short lease), then publishes
via publish_claimed after commit. Restore the accurate in-transaction wording in
the README and the with_bus doc comment.

Implements [[tasks/distributed-tooling-crate-extraction]]

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 6, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7b0f4f74-1c09-45df-b4c8-59cb914af7a6

📥 Commits

Reviewing files that changed from the base of the PR and between 2afc640 and f79a24b.

📒 Files selected for processing (2)
  • README.md
  • src/microsvc/runtime.rs

📝 Walkthrough

Walkthrough

Documentation updates clarify the outbox pattern's bus-attached publishing sequence. The README and Service::with_bus comment are reworded to reflect that outbox rows are claimed as InFlight under a short lease within the commit transaction, then immediately published after commit.

Changes

Outbox pattern claiming and publishing sequence

Layer / File(s) Summary
Outbox claiming and publishing documentation
README.md, src/microsvc/runtime.rs
README section "Publishing the Outbox" and Service::with_bus documentation comment are clarified to describe that outbox-row claiming occurs within the commit transaction (as InFlight state under short lease) before immediate post-commit publication through the attached bus.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 The outbox now dances in perfect order,
Claiming within bounds, then crossing the border,
A lease in the transaction, a publish so fleet,
The documentation and code finally meet! 📝✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: it corrects documentation about outbox claim timing to reflect the in-transaction behavior that was previously documented.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/outbox-claim-timing-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@patrickleet patrickleet merged commit 4bfbdd0 into main Jun 6, 2026
7 checks passed
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