Skip to content

docs: document accept_video token binding and stop_video semantics (whatsapp-rust#1051) - #434

Merged
jlucaso1 merged 1 commit into
mainfrom
claude/nifty-bohr-d1k14c
Jul 24, 2026
Merged

jlucaso1 merged 1 commit into
mainfrom
claude/nifty-bohr-d1k14c

Conversation

@jlucaso1

@jlucaso1 jlucaso1 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Updates guides/voip-calls.mdx for the breaking VoIP changes merged in whatsapp-rust#1051 ("fix(voip): prevent stale audio-to-video upgrades"):

  • CallHandle::accept_video now takes a VideoUpgradeToken as its first argument (was accept_video(source, sink), now accept_video(request, source, sink)). Documented the new signature in the "Peer initiates" flow and the Call Handle method table.
  • CallEvent::VideoStateChanged gained an upgrade_token: Option<VideoUpgradeToken> field — documented what None means (auto-resolved transition) and how to pass Some(token) through to accept_video.
  • New CallError::VideoUpgradeExpired, returned when accept_video is called with a stale/cancelled/superseded token — documented alongside the token.
  • stop_video semantics narrowed: it now only stops our own outbound video; the peer's plane stays up if they keep sending. Previously documented as a full downgrade to audio-only — corrected.
  • New 5-second auto-cancel for an unanswered start_video upgrade (VideoState::UpgradeCancelByTimeout) — documented as a Note near the video-upgrade flows and in the method table.
  • The voip-cli example's --video flag now auto-accepts a peer's mid-call video upgrade even when the call started as audio-only (previously only for calls that were video from the start) — documented in the CLI subcommand table.
  • Added an upgrade warning near the top of the guide pointing existing readers at the breaking signature change.

No other doc file references CallError, VideoState, accept_video, or VideoUpgradeToken, so guides/voip-calls.mdx was the only file needing updates. Changelog entries are intentionally left untouched, per repo convention.


Generated by Claude Code


Summary by cubic

Updates the VoIP guide to reflect breaking changes from whatsapp-rust PR #1051: accept_video now requires a VideoUpgradeToken, stop_video only stops local video, and unanswered upgrades auto-cancel after 5s. Also clarifies the event payload and notes CLI --video auto-accept behavior.

  • Migration
    • Pass upgrade_token from CallEvent::VideoStateChanged to handle.accept_video(token, ...).
    • Handle CallError::VideoUpgradeExpired for stale/cancelled/superseded tokens.
    • Treat handle.stop_video() as stopping only your outbound video; the peer may keep sending.
    • Expect start_video to auto-cancel after 5s if the peer doesn’t answer.

Written for commit f67a817. Summary will update on new commits.

…hatsapp-rust#1051)

PR #1051 changed accept_video to take a VideoUpgradeToken (rejecting
stale requests with CallError::VideoUpgradeExpired), added the token
to CallEvent::VideoStateChanged, narrowed stop_video to only affect
our own outbound video, added a 5s auto-cancel for unanswered
upgrades, and made the CLI's --video auto-accept upgrades on
calls that started as audio.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HaZ6NQMqjh5YMCgL8nXRDT
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jlucaso1, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 17 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e304c023-010f-432c-827e-b2d46830e8b9

📥 Commits

Reviewing files that changed from the base of the PR and between 6ee63c7 and f67a817.

📒 Files selected for processing (1)
  • guides/voip-calls.mdx

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.

@mintlify

mintlify Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
whatsapp-rust 🟢 Ready View Preview Jul 24, 2026, 8:42 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@jlucaso1
jlucaso1 merged commit b5a74d3 into main Jul 24, 2026
4 checks passed
@greptile-apps

greptile-apps Bot commented Jul 24, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates guides/voip-calls.mdx to document all breaking changes from whatsapp-rust PR #1051: the new VideoUpgradeToken argument on accept_video, the upgrade_token field added to CallEvent::VideoStateChanged, the new CallError::VideoUpgradeExpired error, corrected stop_video semantics (outbound-only, not a full call downgrade), the 5-second start_video auto-cancel timeout, and the voip-cli --video flag now auto-accepting mid-call peer upgrades.

  • An upgrade <Warning> and a code-example rewrite in "Peer initiates" accurately reflect the new accept_video(token, source, sink) signature and explain when upgrade_token is None.
  • The stop_video clarification and the 5-second timeout <Note> are new additions that were absent from the previous version of the guide.
  • The Call Handle method table is updated throughout to match the new signatures and semantics.

Confidence Score: 4/5

Safe to merge — all documented API signatures, semantics, and error variants match the described SDK changes and no technical content is missing or incorrect.

The technical content is accurate and complete. The only findings are presentation-level: the new warning's anchor link navigates to the wrong granularity (Video I/O section top rather than the "Peer initiates" paragraph), two consecutive Warning callouts appear at the top of the page, and the changelog entry question is unresolved. None of these affect correctness for readers who read carefully.

guides/voip-calls.mdx — the new Warning callout at the top and its anchor link are worth a second look before merge.

Important Files Changed

Filename Overview
guides/voip-calls.mdx Documents all PR #1051 breaking changes accurately: new accept_video(token, source, sink) signature, upgrade_token field on VideoStateChanged, CallError::VideoUpgradeExpired, corrected stop_video semantics, 5-second auto-cancel, and updated CLI --video behavior. Two P2 style issues: anchor link text mismatch in the new Warning, and consecutive Warning callouts that could be merged. No missing or incorrect technical content observed.

Sequence Diagram

sequenceDiagram
    participant Peer as Peer
    participant Lib as whatsapp-rust
    participant App as Application

    Note over Peer,App: Peer-initiated video upgrade
    Peer->>Lib: "video UpgradeRequestV2"
    Lib->>App: "VideoStateChanged { state: UpgradeRequestV2, upgrade_token: Some(token) }"
    App->>Lib: "accept_video(token, camera_source, sink)"
    alt token valid
        Lib->>Peer: "UpgradeAccept + Enabled stanza"
    else token expired or cancelled
        Lib->>App: "Err(CallError::VideoUpgradeExpired)"
    end

    Note over Peer,App: Self-initiated video upgrade
    App->>Lib: "start_video(camera_source, sink)"
    Lib->>Peer: "UpgradeRequestV2"
    alt peer accepts within 5 s
        Peer->>Lib: "UpgradeAccept"
        Lib->>App: "VideoStateChanged { state: UpgradeAccept }"
    else timeout
        Lib->>Peer: "UpgradeCancelByTimeout"
        Lib->>App: "VideoStateChanged { state: UpgradeCancelByTimeout }"
    end

    Note over Peer,App: Stopping outbound video
    App->>Lib: "stop_video()"
    Lib->>App: "ok — outbound plane stopped, peer plane unaffected"
Loading

Comments Outside Diff (1)

  1. guides/voip-calls.mdx, line 1-4 (link)

    P2 Missing changelog entry for a breaking SDK change

    The repo's documented workflow (.mintlify/ automation and the knowledge base) expects a dated changelog entry under changelog/ for each SDK PR that affects the docs. PR #1051 is a breaking signature change (accept_video gains a required argument; CallEvent::VideoStateChanged gains a new field), yet no entry was added. The PR description says this is "per repo convention," but the repo's own contributor guide describes changelog entries as a required step when updating docs in response to an upstream SDK PR. If the convention has changed, it would be worth a comment in CONTRIBUTING.md or AGENTS.md so future contributors have a clear signal.

    Knowledge Base Used: Changelog

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: guides/voip-calls.mdx
    Line: 1-4
    
    Comment:
    **Missing changelog entry for a breaking SDK change**
    
    The repo's documented workflow (`.mintlify/` automation and the knowledge base) expects a dated changelog entry under `changelog/` for each SDK PR that affects the docs. PR #1051 is a breaking signature change (`accept_video` gains a required argument; `CallEvent::VideoStateChanged` gains a new field), yet no entry was added. The PR description says this is "per repo convention," but the repo's own contributor guide describes changelog entries as a required step when updating docs in response to an upstream SDK PR. If the convention has changed, it would be worth a comment in `CONTRIBUTING.md` or `AGENTS.md` so future contributors have a clear signal.
    
    **Knowledge Base Used:** [Changelog](https://app.greptile.com/oxidezap/-/custom-context/knowledge-base/oxidezap/whatsapp-rust-docs/-/docs/changelog.md)
    
    How can I resolve this? If you propose a fix, please make it concise.

    Fix in Claude Code

Fix All in Claude Code

Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
guides/voip-calls.mdx:23
**Anchor link text doesn't match destination**

The link `[Peer initiates](#video-io)` navigates to the `## Video I/O` section heading — not to the `**Peer initiates**` bold paragraph within it, which has no anchor because it isn't a heading. A reader who clicks the link lands at the top of Video I/O and must scroll to locate the relevant paragraph. Consider either changing the link text to `[Video I/O](#video-io)` to match the actual destination, or promoting `**Peer initiates**` to a `###` sub-heading (which would generate its own `#peer-initiates` anchor Mintlify can deep-link to).

### Issue 2 of 3
guides/voip-calls.mdx:22-24
**Two consecutive `<Warning>` callouts**

The new warning is placed immediately after the existing one, producing two consecutive orange/red warning banners at the top of the page. Mintlify renders these as visually identical blocks, so readers may skim past the second. Consider folding the PR #1051 breaking-change note into the existing warning (e.g. as a second sentence or a bullet list item), or placing it as a `<Warning>` immediately before the "Peer initiates" paragraph in the Video I/O section where it's most actionable — that would also resolve the anchor-link issue noted separately.

### Issue 3 of 3
guides/voip-calls.mdx:1-4
**Missing changelog entry for a breaking SDK change**

The repo's documented workflow (`.mintlify/` automation and the knowledge base) expects a dated changelog entry under `changelog/` for each SDK PR that affects the docs. PR #1051 is a breaking signature change (`accept_video` gains a required argument; `CallEvent::VideoStateChanged` gains a new field), yet no entry was added. The PR description says this is "per repo convention," but the repo's own contributor guide describes changelog entries as a required step when updating docs in response to an upstream SDK PR. If the convention has changed, it would be worth a comment in `CONTRIBUTING.md` or `AGENTS.md` so future contributors have a clear signal.

Reviews (1): Last reviewed commit: "docs: document accept_video token bindin..." | Re-trigger Greptile

Comment thread guides/voip-calls.mdx
</Warning>

<Warning>
[PR #1051](https://github.com/oxidezap/whatsapp-rust/pull/1051) changed `CallHandle::accept_video`'s signature and the shape of `CallEvent::VideoStateChanged` to close a race where a cancelled or superseded video-upgrade request could still attach a camera. If you're upgrading from before this PR, see [Peer initiates](#video-io) below and the `VideoUpgradeToken` field on the event.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 partner Anchor link text doesn't match destination

The link [Peer initiates](#video-io) navigates to the ## Video I/O section heading — not to the **Peer initiates** bold paragraph within it, which has no anchor because it isn't a heading. A reader who clicks the link lands at the top of Video I/O and must scroll to locate the relevant paragraph. Consider either changing the link text to [Video I/O](#video-io) to match the actual destination, or promoting **Peer initiates** to a ### sub-heading (which would generate its own #peer-initiates anchor Mintlify can deep-link to).

Prompt To Fix With AI
This is a comment left during a code review.
Path: guides/voip-calls.mdx
Line: 23

Comment:
**Anchor link text doesn't match destination**

The link `[Peer initiates](#video-io)` navigates to the `## Video I/O` section heading — not to the `**Peer initiates**` bold paragraph within it, which has no anchor because it isn't a heading. A reader who clicks the link lands at the top of Video I/O and must scroll to locate the relevant paragraph. Consider either changing the link text to `[Video I/O](#video-io)` to match the actual destination, or promoting `**Peer initiates**` to a `###` sub-heading (which would generate its own `#peer-initiates` anchor Mintlify can deep-link to).

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

Comment thread guides/voip-calls.mdx
Comment on lines +22 to +24
<Warning>
[PR #1051](https://github.com/oxidezap/whatsapp-rust/pull/1051) changed `CallHandle::accept_video`'s signature and the shape of `CallEvent::VideoStateChanged` to close a race where a cancelled or superseded video-upgrade request could still attach a camera. If you're upgrading from before this PR, see [Peer initiates](#video-io) below and the `VideoUpgradeToken` field on the event.
</Warning>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 partner Two consecutive <Warning> callouts

The new warning is placed immediately after the existing one, producing two consecutive orange/red warning banners at the top of the page. Mintlify renders these as visually identical blocks, so readers may skim past the second. Consider folding the PR #1051 breaking-change note into the existing warning (e.g. as a second sentence or a bullet list item), or placing it as a <Warning> immediately before the "Peer initiates" paragraph in the Video I/O section where it's most actionable — that would also resolve the anchor-link issue noted separately.

Prompt To Fix With AI
This is a comment left during a code review.
Path: guides/voip-calls.mdx
Line: 22-24

Comment:
**Two consecutive `<Warning>` callouts**

The new warning is placed immediately after the existing one, producing two consecutive orange/red warning banners at the top of the page. Mintlify renders these as visually identical blocks, so readers may skim past the second. Consider folding the PR #1051 breaking-change note into the existing warning (e.g. as a second sentence or a bullet list item), or placing it as a `<Warning>` immediately before the "Peer initiates" paragraph in the Video I/O section where it's most actionable — that would also resolve the anchor-link issue noted separately.

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

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.

2 participants