Repository navigation
Conversation
…ck and the paths it guards Refs #636. MailClient pinned its promotion lock root at construction while its mailbox file paths and replay-state path were joined from the configured mail directory at each use. If the mail root was re-pointed or moved while a long-running client was alive, the promotion lock stayed under the old root while the files and the replay state followed the new one, so a second process holding the new root's lock did not exclude promotion and a delivery could repeat. Resolve the mailbox root once per operation and derive the promotion lock path, the mailbox file paths and the replay-state path from that one value, so a re-pointed root moves all three together. Test: a real-filesystem case re-points the mail root under a live client while a real second process holds the new root's lock; the client does not promote under the old root's lock, and the one envelope is delivered once.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
|
Prose sweep (cli#636, measured on a0833a0). Every sentence this PR adds or changes, checked against the code for (a) outcomes on every branch, (b) scope words, (c) coverage claims. Call per sentence. Source comments —
New test — Changelog fragment — Edited tests — No failing sentences. |
Closes #636.
What changed
MailClientpinned its promotion lock root at construction, while its mailbox file paths and replay-state path followed the configured mail directory at each use. If the mail root was re-pointed or moved while a long-running client was alive, the promotion lock stayed under the old root while the files and the replay state followed the new one: a second process holding the new root's lock did not exclude promotion, so a delivery could repeat.The mailbox root is now resolved once per operation, and the promotion lock path, the mailbox file paths and the replay-state path all derive from that one value. A re-pointed root moves all three together.
Evidence
Measured on a0833a0 (main 78d295e).
packages/agent/test/mail-client-repoint-root.test.ts(real filesystem, a real second process holding the new root's mailbox lock): red on main — it fails the assertion that the client does not promote under the old root's lock — and green at this head.node scripts/changelog-fragments.mjs checkpasses;bun run lint:ciexits 0;tscbuildspackages/agentandpackages/cli.