docs: per-chat resend rate limiter (whatsapp-rust PR #871) - #334
docs: per-chat resend rate limiter (whatsapp-rust PR #871)#334jlucaso1 wants to merge 5 commits into
Conversation
📝 WalkthroughWalkthroughDocumentation-only PR adding a per-chat outbound resend token-bucket rate limiter across three files: a new changelog entry, the ChangesPer-chat resend rate limiter documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f84a1d86a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ``` | ||
|
|
||
| <Tip> | ||
| Configure at build time via [`BotBuilder::with_resend_rate_limit`](/api/bot#with-resend-rate-limit). Use this method only to tune live without restarting. |
There was a problem hiding this comment.
Fix the BotBuilder anchor link
This new cross-link points to #with-resend-rate-limit, but the target section added in api/bot.mdx is headed ### with_resend_rate_limit, matching the repo's existing snake_case anchor style for Rust methods. When readers click this tip, the fragment will not jump to the new builder method and link checks for this internal anchor will fail; point it at /api/bot#with_resend_rate_limit instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@api/bot.mdx`:
- Line 557: The second sentence in the paragraph starting with "Can also be
retuned live after build via" is a sentence fragment missing an explicit
subject. Add a clear subject (such as "The rate limit" or "It") at the beginning
of this sentence to make it a complete, direct statement that explicitly
identifies what can be retuned.
In `@changelog/2026-06-15-per-chat-resend-rate-limit.mdx`:
- Line 33: In the changelog/2026-06-15-per-chat-resend-rate-limit.mdx file,
replace the `###` subheadings for API entry titles with bold text formatting
instead. At lines 33, 45, 57, 68, and 72, convert each `###
BotBuilder::with_resend_rate_limit` and similar API entry headings into bold
titles (e.g., `**BotBuilder::with_resend_rate_limit**`). Keep the section-level
headings at `##` format, and use bold formatting only for the individual API
entry names nested under the `## New API` section to follow the changelog
convention.
- Line 10: The sentence starting with "During a mass PN-to-LID migration..."
contains multiple distinct ideas and should be split into shorter, more concise
statements to improve readability in the changelog. Break this run-on sentence
into 3-4 separate sentences, where each sentence conveys one main idea: first
explain the migration scenario and device failure, then describe the library's
resend behavior, then explain the rate-limiting issue, and finally state the
resulting error. This will align with documentation guidelines that require one
idea per sentence.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 2e6ed39f-16d0-4893-afcb-73b239c779db
📒 Files selected for processing (4)
api/bot.mdxapi/client.mdxchangelog/2026-06-15-per-chat-resend-rate-limit.mdxdocs.json
There was a problem hiding this comment.
1 issue found across 4 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
- api/bot.mdx: fix sentence fragment in with_resend_rate_limit description
("Defaults apply..." → "If you do not call this method, defaults apply...")
- changelog: split run-on sentence in Problem section into shorter statements
- changelog: convert ### API subheadings to bold per changelog conventions
Documents the per-chat token-bucket resend rate limiter introduced in oxidezap/whatsapp-rust#871.
Changes
changelog/2026-06-15-per-chat-resend-rate-limit.mdx(new): Changelog entry covering the problem (PN-to-LID migration fan-out storms), fix mechanics (token bucket, drop semantics, monotonic clock, fail-open eviction, group-only), defaults, and all new API surface.docs.json: Registered the new changelog entry immediately afterchangelog/overview.api/bot.mdx: AddedBotBuilder::with_resend_rate_limit(burst, refill_per_min)section andresend_rate_limiter_capacityrow in the cache config table.api/client.mdx: AddedClient::set_resend_rate_limitandClient::resends_throttled_totalmethod docs, plus two new rows in theMemoryDiagnosticstable (resend_rate_limiter_chats,resends_throttled_total).Defaults
Applies to group chats only — DMs retain unconditional resend (bounded by
MAX_RETRY_COUNT).Generated by Claude Code
Summary by cubic
Adds docs for the per-chat token-bucket resend rate limiter on group retry resends, with build-time and live tuning, metrics, defaults, and cache capacity. Reduces
AccountLockedrisk during PN-to-LID fan-out storms inoxidezap/whatsapp-rust.New Features
BotBuilder::with_resend_rate_limit(burst, refill_per_min); cache config addsresend_rate_limiter_capacity.Client::set_resend_rate_limit,Client::resends_throttled_total;MemoryDiagnosticsaddsresend_rate_limiter_chats,resends_throttled_total.docs.json: registers the new changelog entry.Bug Fixes
api/client.mdxanchor forBotBuilder::with_resend_rate_limit(snake_case#with_resend_rate_limit).api/bot.mdxto fix a sentence fragment inwith_resend_rate_limit.Written for commit bfb2294. Summary will update on new commits.
Summary by CodeRabbit