Fix mail integrity, send recovery, concurrency, and maintenance - #116
Conversation
|
Important Review skippedToo many files! This PR contains 109 files, which is 9 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (109)
You can disable this status message by setting the 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 |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Summary
Prevent incomplete inbound mail, duplicate sends after storage failures, lost draft edits, and removal of the last owner during concurrent requests. This applies the codebase audit fixes to
mainand adds the related performance and maintenance improvements.Adds migration
0029_mail_reliability.sql, after-deploy migration0004_mail_reliability_guards.sql, and release schema version 4. Fresh-install and populated-upgrade checks cover the migration sequence. Product version and release publication remain part of the normal release process.Verification
pnpm checkon Linux and Windows: 882 unit tests passed on Linux (2 Windows-only tests skipped), 884 on Windows; 214 Worker integration tests passed on both. Coverage, architecture, API checks, and production builds passed.pnpm deploy:dry-runon Linux and Windowspnpm check7766795c35b15063b9fdd42281d4179a4fc0dcd1: provisioning recovery, populated migration upgrade and retry, eight browser checks, hostname move and return, populated backup/restore, and disposable resource cleanup all passed.The app chunk fell from 902.00 kB to 355.00 kB (271.63 kB to 106.23 kB gzip). A local synthetic 10,000-message query took 19.4 ms with the narrower projection versus 74.1 ms with the wide projection. This is a local measurement, not a production latency claim.
The regression suite covers partial R2 and D1 failures, accepted-send recovery, uncertain-send protection, concurrent draft saves and owner changes, job leases and failed continuation publication, scans beyond 10,000 objects, large text bodies, request stream limits, stale inbox rows, draft paging, and missed socket wake-ups. Worker files previously excluded from unit coverage are now included; integration results remain separate evidence.
Notes
API callers need a saved draft or an
idempotencyKeyfor a safe send retry. An uncertain provider result requires review; it is never sent again automatically. Full-text search covers the first 256 KiB of large plain-text bodies. Recovery checkpoints do not copy R2 objects; independent object backups are still required. New verified checkpoints use format v2, while older checkpoint files require manual recovery.Canonical specifications and the operations guide are updated in HQBase/hqbase-site#49. Merge the paired changes together. No production deployment or release is included.