docs: document last_data_sent_ms removal and is_dead_socket_at (whatsapp-rust#1103) - #438
Conversation
…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
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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. |
|
| 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
Reviews (1): Last reviewed commit: "docs: document last_data_sent_ms removal..." | Re-trigger Greptile
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
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 thelast_data_sent_msrow from theStatsSnapshotfields table, updated the "exceptions" sentence to only describelast_data_received_ms/reconnect_errors, and added a<Note>documenting the breaking removal and migration path (frames_sentfor "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 vialast_data_received_msandfirst_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 callsis_dead_socket_at(first_send_since_recv, last_recv, now)against a single clock read shared with the elapsed-time log message (previouslyis_dead_socketread the clock internally), and removed the now-stale reference tolast_data_sent_ms"tracking the most recent send for telemetry."No changelog entry included per instructions (changelog entries are added by humans).
Test plan
_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).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_msand the new dead-socket APIis_dead_socket_at, clarifying keepalive behavior and the timestamp fields that remain. This removes a per-frame clock read and documents the migration path.last_data_sent_msis gone. Useframes_sentto check if the client is sending; if you need a last-write timestamp, stamp it at your send call site.is_dead_socket_at(first_send_since_recv, last_recv, now). Read the clock once and passnow.last_data_received_msandfirst_send_since_recv_ms. No "last send" timestamp.Written for commit 5f5af8a. Summary will update on new commits.