From 30d2f2b830198569248ee734a1d2dfdb341b1fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyrille=20B=C3=A9raud?= Date: Sat, 26 Sep 2026 14:30:34 -0400 Subject: [PATCH] proxy_client: fetch the value announced by a push of a stale session When a push carries the session of a previous client, it is dropped and the subscriptions are sent again so the proxy learns the current session. But they were sent as refreshes, which the proxy answers with no values: the value announced by the dropped push was still lost. That value is typically the connection request of an incoming call. The proxy notifies with another session when another instance of the client subscribed last: on Android, the instance that ran before the account was restarted in doze, the new one being unable to subscribe yet; on iOS, the notification extension, while the app resumes with its account still active. Send them as full subscriptions, which also return the stored values. The listener value cache drops the values already received. Co-authored-by: Copilot (Claude Opus 5.5) <223556219+Copilot@users.noreply.github.com> --- src/dht_proxy_client.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dht_proxy_client.cpp b/src/dht_proxy_client.cpp index ebf67c06..76fcc47c 100644 --- a/src/dht_proxy_client.cpp +++ b/src/dht_proxy_client.cpp @@ -1219,11 +1219,13 @@ DhtProxyClient::restartListeners(const asio::error_code& ec) // now, so the server learns the session id of this run: healthy // listeners are skipped by the loop below, and would otherwise // never be subscribed for push at all. + // Also set after a push of a stale session was dropped: ask for the + // stored values too, or the value that push announced is lost. if (logger_) logger_->debug("[proxy:client] [listeners] sending deferred push subscriptions"); for (auto& search : searches_) for (auto& listener : search.second.listeners) - resubscribe(search.first, listener.first, listener.second); + resubscribe(search.first, listener.first, listener.second, true); return; } if (logger_) @@ -1288,7 +1290,8 @@ DhtProxyClient::pushNotificationReceived([[maybe_unused]] const std::map