Context
PR #506 fixed <unavailable> by requesting PDO from the primary phone. However, in testing, the PDO-only approach doesn't reliably deliver messages.
What Works
The original approach in #506's first commit (handle_decrypt_failure with RetryReason::NoSession) worked reliably — messages arrived via PDO relay within 1 second. This sends both:
- A retry receipt to the sender
- A PDO request to the primary phone (via
spawn_pdo_request inside handle_decrypt_failure)
What Doesn't Work Reliably
The second commit changed to spawn_pdo_request_with_options(&info, true) only (no retry receipt). In testing:
- PDO request is sent successfully
- Primary phone acknowledges with a Delivered receipt
- But the PDO response never comes back (waited 60+ seconds)
- The phone is confirmed online (delivery receipt proves it)
Hypothesis
The retry receipt may be needed because:
- It tells the sender to re-encrypt for this specific device
- The sender's re-encryption triggers the WA server to route properly
- Without the retry receipt, the phone receives the PDO request but doesn't know it needs to relay
Proposed Fix
Add self.spawn_retry_receipt(&info, RetryReason::NoSession) alongside the existing spawn_pdo_request_with_options, similar to how handle_decrypt_failure does both:
if let Some(unavailable) = unavailable_node {
// ... existing code ...
self.spawn_pdo_request_with_options(&info, true);
self.spawn_retry_receipt(&info, RetryReason::NoSession); // ADD THIS
self.core.event_bus.dispatch(&Event::UndecryptableMessage(...));
return;
}
Testing
- Tested with two wa-rs companion devices on different WA accounts
- With retry receipt: message delivered via PDO in <1 second
- Without retry receipt (current code): PDO request sent, phone acks, but no relay
Context
PR #506 fixed
<unavailable>by requesting PDO from the primary phone. However, in testing, the PDO-only approach doesn't reliably deliver messages.What Works
The original approach in #506's first commit (
handle_decrypt_failurewithRetryReason::NoSession) worked reliably — messages arrived via PDO relay within 1 second. This sends both:spawn_pdo_requestinsidehandle_decrypt_failure)What Doesn't Work Reliably
The second commit changed to
spawn_pdo_request_with_options(&info, true)only (no retry receipt). In testing:Hypothesis
The retry receipt may be needed because:
Proposed Fix
Add
self.spawn_retry_receipt(&info, RetryReason::NoSession)alongside the existingspawn_pdo_request_with_options, similar to howhandle_decrypt_failuredoes both:Testing