Skip to content

docs: document last_data_sent_ms removal and is_dead_socket_at (whatsapp-rust#1103) - #438

Merged
jlucaso1 merged 1 commit into
mainfrom
claude/nifty-bohr-6fnfg5
Jul 25, 2026
Merged

docs: document last_data_sent_ms removal and is_dead_socket_at (whatsapp-rust#1103)#438
jlucaso1 merged 1 commit into
mainfrom
claude/nifty-bohr-6fnfg5

Conversation

@jlucaso1

@jlucaso1 jlucaso1 commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Updates docs for whatsapp-rust#1103 ("perf(stats): stop dating every wire frame for a field nothing reads"), a breaking-change perf PR that removed StatsSnapshot::last_data_sent_ms / SessionStats::last_data_sent_ms() because nothing internal ever read the field, and stamping it cost a wall-clock read on every frame written.

  • api/client.mdx — removed the last_data_sent_ms row from the StatsSnapshot fields table, updated the "exceptions" sentence to only describe last_data_received_ms/reconnect_errors, and added a <Note> documenting the breaking removal and migration path (frames_sent for "is it still sending?"; embedders needing a last-write timestamp should stamp it at their own send call site).
  • concepts/architecture.mdx — updated the keepalive-loop description: the two loops now communicate only via last_data_received_ms and first_send_since_recv_ms; explained why there's no "last send" timestamp.
  • advanced/websocket-handling.mdx — updated the dead-socket-detection walkthrough: the keepalive tick now calls is_dead_socket_at(first_send_since_recv, last_recv, now) against a single clock read shared with the elapsed-time log message (previously is_dead_socket read the clock internally), and removed the now-stale reference to last_data_sent_ms "tracking the most recent send for telemetry."

No changelog entry included per instructions (changelog entries are added by humans).

Test plan

  • Verified the removed field and new _at-suffixed functions (is_dead_socket_at, ms_since_at, now_ms) against the whatsapp-rust#1103 diff and local source (wacore/src/stats.rs, wacore/src/protocol/keepalive.rs, src/keepalive.rs).
  • Confirmed StatsSnapshot::last_data_sent_ms / SessionStats::last_data_sent_ms() have no other doc references left (pt/ translations don't cover these pages).

Generated by Claude Code


Summary by cubic

Update docs to reflect removal of last_data_sent_ms and the new dead-socket API is_dead_socket_at, clarifying keepalive behavior and the timestamp fields that remain. This removes a per-frame clock read and documents the migration path.

  • Migration
    • last_data_sent_ms is gone. Use frames_sent to check if the client is sending; if you need a last-write timestamp, stamp it at your send call site.
    • Dead-socket check now uses is_dead_socket_at(first_send_since_recv, last_recv, now). Read the clock once and pass now.
    • Keepalive and read loops share only last_data_received_ms and first_send_since_recv_ms. No "last send" timestamp.

Written for commit 5f5af8a. Summary will update on new commits.

…app-rust#1103)

SessionStats::record_frame_sent no longer stamps a wall clock read on
every frame; last_data_sent_ms had no internal reader and is gone.
Update the StatsSnapshot field table, the keepalive-loop architecture
overview, and the dead-socket-detection walkthrough to match, and note
the breaking removal with its migration path.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHhQ4WHBmrgcwoPUoh5Hbk
@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 25, 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: 54 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: 0620e894-ace4-40f1-aa94-08064d2b73eb

📥 Commits

Reviewing files that changed from the base of the PR and between ee54554 and 5f5af8a.

📒 Files selected for processing (3)
  • advanced/websocket-handling.mdx
  • api/client.mdx
  • concepts/architecture.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 25, 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 25, 2026, 4:08 AM

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

@greptile-apps

greptile-apps Bot commented Jul 25, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates three documentation files to reflect the removal of StatsSnapshot::last_data_sent_ms / SessionStats::last_data_sent_ms() from the Rust library, and the change of is_dead_socket to is_dead_socket_at (accepting a pre-read clock value instead of reading it internally).

  • api/client.mdx: Removes the last_data_sent_ms row from the StatsSnapshot table, revises the "exceptions" prose, and adds a <Note> block documenting the breaking removal with a migration path.
  • concepts/architecture.mdx: Trims the atomic-timestamp list to only last_data_received_ms and first_send_since_recv_ms, adds a sentence explaining why no "last send" field exists.
  • advanced/websocket-handling.mdx: Updates the dead-socket-detection paragraph to reference is_dead_socket_at(first_send_since_recv, last_recv, now) and explains the single-clock-read optimisation.

Confidence Score: 5/5

Documentation-only changes accurately reflect a breaking API removal; no code logic is touched.

All three files make narrow, targeted edits — removing one field row, updating one paragraph, and updating one function signature reference. The remaining two mentions of last_data_sent_ms in the docs are intentional (one in the migration note, one explaining the field no longer exists). The pt/ translations confirmed in the PR don't cover these pages. No inconsistencies or stale references were found.

Files Needing Attention: No files require special attention.

Important Files Changed

Filename Overview
api/client.mdx Removes the last_data_sent_ms field row, updates the "exceptions" sentence to describe only last_data_received_ms and reconnect_errors, and adds a <Note> explaining the breaking removal and migration advice — all internally consistent.
concepts/architecture.mdx Removes last_data_sent_ms from the atomic-timestamp list and adds a sentence explaining the absence of a "last send" timestamp — straightforward one-line doc update, no issues found.
advanced/websocket-handling.mdx Updates the dead-socket-detection walkthrough from is_dead_socket to is_dead_socket_at (with the now parameter), removes the stale last_data_sent_ms telemetry reference, and explains the single-clock-read optimisation — accurate and consistent with the described API change.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Keepalive tick fires] --> B[Read clock once into 'now']
    B --> C{first_send_since_recv armed?}
    C -- No --> D[Skip dead-socket check]
    C -- Yes --> E["is_dead_socket_at(first_send_since_recv, last_recv, now)"]
    E -- Dead --> F[reconnect_immediately + exit loop]
    E -- Alive --> G[Log elapsed time using same 'now']
    G --> H[Send ping if interval elapsed]
    H --> I[Wait for next tick]
    D --> H
Loading

Reviews (1): Last reviewed commit: "docs: document last_data_sent_ms removal..." | Re-trigger Greptile

@jlucaso1
jlucaso1 merged commit 24290ba into main Jul 25, 2026
4 checks passed
@mintlify

mintlify Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

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

Project Status Preview Updated (UTC)
whatsapp-rust 🟡 Building Jul 25, 2026, 4:08 AM

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

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