feat(history_sync): expose peer_data_request_session_id on LazyHistorySync - #614
Conversation
…ySync Propagate the PDO session id from `HistorySyncNotification` onto the dispatched event so consumers can correlate ON_DEMAND history sync answers with their outstanding `fetchMessageHistory` / `requestPlaceholderResend` requests, matching WA Web's `HistorySyncNotification` handler.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughA new optional ChangesSession ID Metadata for History Sync
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Look, this is solid work. The pattern is clean and consistent—you're adding metadata to track session correlation on history syncs, which is exactly what you need to match responses to requests. The field threads through correctly: it's optional by default, there's a builder to set it when needed, and it's carried all the way through serialization and dispatch. Tests cover it. No surprises, no edge cases getting missed. This is how you do incremental API expansion right. Ship it. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
Summary
peer_data_request_session_id: Option<String>field toLazyHistorySync, populated from the originatingHistorySyncNotification.with_peer_data_request_session_id) and accessor;Clone,Debug, andSerializeimpls all updated.ON_DEMANDhistory sync answers with their outstandingfetchMessageHistory/requestPlaceholderResendrequests, matching WA Web'sHistorySyncNotificationhandler (docs/captured-js/WAWeb/Handle/HistorySyncNotification.js:98,:195-234).Test plan
cargo buildcargo clippy --all --testscargo test -p wacore --lib lazy_history_sync(8/8 pass, including the newlazy_history_sync_peer_data_request_session_idround-trip test)