docs: document typed stanza ack/reject/retry API - #421
Conversation
Covers the new whatsapp-rust APIs added in oxidezap/whatsapp-rust#1069: Client::acknowledge_stanza, Client::reject_stanza (with StanzaRejection/ StanzaResponseError), and Client::request_message_retry (with RetryRequestOptions/RetryRequestOutcome/RetryRequestError). Also notes two behavior changes from that PR: malformed message stanzas now get an explicit nack instead of a silent drop, and the retry key-bundle inclusion policy no longer special-cases the diagnostic retry reason. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ExpD4zYrxBMPK5TYuH7qML
📝 WalkthroughWalkthroughDocumentation adds manual stanza acknowledgement and rejection APIs, clarifies parsing-error acknowledgements for malformed messages, and documents exported retry reasons plus caller-controlled message retry requests. ChangesProtocol response and retry documentation
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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: 1e0fb952b3
ℹ️ 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".
Addresses Codex review feedback on PR #421: request_message_retry's group/status path also requires a valid participant attr via parse_message_info, surfacing as RetryRequestError::InvalidStanza. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ExpD4zYrxBMPK5TYuH7qML
|
| Filename | Overview |
|---|---|
| advanced/binary-protocol.mdx | Adds manual stanza acknowledgement and rejection API documentation with consistent cross-links. |
| concepts/architecture.mdx | Documents explicit parsing-error nacks and fail-fast message metadata parsing. |
| guides/receiving-messages.mdx | Adds manual retry API documentation, outcome semantics, and key-inclusion rules. |
Reviews (1): Last reviewed commit: "docs: document conditional participant r..." | Re-trigger Greptile
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@advanced/binary-protocol.mdx`:
- Around line 976-1006: Revise the documentation at advanced/binary-protocol.mdx
lines 976-1006, concepts/architecture.mdx line 456, and
guides/receiving-messages.mdx lines 449-476 to consistently address readers as
“you,” use active voice, and keep one idea per sentence. In binary-protocol.mdx
and receiving-messages.mdx, split dense API, validation, and outcome rules into
shorter sentences; in architecture.mdx, separate parsing behavior from
acknowledgement behavior. Preserve all existing technical details and behavior.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 72a03f4d-b1c6-4e6c-a9cf-3ae4cd909163
📒 Files selected for processing (3)
advanced/binary-protocol.mdxconcepts/architecture.mdxguides/receiving-messages.mdx
Summary
Documents the public API added in oxidezap/whatsapp-rust#1069 ("feat(core): expose typed stanza responses and retries").
advanced/binary-protocol.mdx— new "Manual stanza acknowledgement" section documentingClient::acknowledge_stanzaandClient::reject_stanza, plus theStanzaRejection/StanzaResponseErrortypes, for callers that intercept raw stanzas themselves (custom transports, replay tooling, mock servers).guides/receiving-messages.mdx— new "Requesting a retry manually" subsection documentingClient::request_message_retryand theRetryRequestOptions/RetryRequestOutcome/RetryRequestErrortypes, plus a note on the retry key-bundle inclusion policy (retry_count >= 2, explicitforce_include_keys, or a stateless/hosted destination — the diagnosticRetryReasonno longer affects wire shape).concepts/architecture.mdx— one-line addition noting that malformed<message>stanzas now receive an explicit<ack error="487">(NackReason::ParsingError) instead of being silently dropped, and thatparse_message_infois now fail-fast on invalid/missingid/from/participant.No changelog entry included, per standing instructions that changelog entries are added by a human.
Test plan
whatsapp-rustrepo (not just its description).minttooling available in this session).🤖 Generated with Claude Code
https://claude.ai/code/session_01ExpD4zYrxBMPK5TYuH7qML
Generated by Claude Code
Summary by cubic
Adds docs for manual stanza ack/nack and manual retry APIs so custom transports and replay tools can respond to stanzas directly. Clarifies retry key-bundle inclusion, the group/status
participantrequirement for manual retries, and that malformed messages now get an explicit nack.Client::acknowledge_stanza,Client::reject_stanza,StanzaRejection,StanzaResponseError.Client::request_message_retry,RetryRequestOptions,RetryRequestOutcome,RetryRequestError; documents key-bundle inclusion rules, that transport acks remain caller-owned, and that group/status paths require a validparticipantor returnRetryRequestError::InvalidStanza.<message>stanzas are nacked with error 487;parse_message_infois fail-fast;RetryReasonno longer changes wire shape for retries.Written for commit 7f758ff. Summary will update on new commits.
Summary by CodeRabbit