Skip to content

opendht: restore push subscriptions immediately on reconnect#855

Open
pknellore wants to merge 1 commit into
savoirfairelinux:masterfrom
pknellore:v3.7.8-branch
Open

opendht: restore push subscriptions immediately on reconnect#855
pknellore wants to merge 1 commit into
savoirfairelinux:masterfrom
pknellore:v3.7.8-branch

Conversation

@pknellore

Copy link
Copy Markdown

When a push notification arrives while the DHT proxy client is Disconnected (e.g. after Android Doze blocks background DNS), arm listenerRestartTimer_ immediately inside pushNotificationReceived() instead of waiting for a successful getProxyInfos() HTTP round-trip.

The push itself proves the proxy is reachable. This mirrors what onProxyInfos() does on a Connected transition but avoids the extra network request that fails under Doze/App Standby when DNS is blocked.

restartListeners() will resubscribe() all listeners whose opstate->ok is false (marked dead by opFailed()), restoring push subscriptions without any additional HTTP overhead.

When a push notification arrives while the DHT proxy client is
Disconnected (e.g. after Android Doze blocks background DNS), arm
listenerRestartTimer_ immediately inside pushNotificationReceived()
instead of waiting for a successful getProxyInfos() HTTP round-trip.

The push itself proves the proxy is reachable. This mirrors what
onProxyInfos() does on a Connected transition but avoids the extra
network request that fails under Doze/App Standby when DNS is blocked.

restartListeners() will resubscribe() all listeners whose opstate->ok
is false (marked dead by opFailed()), restoring push subscriptions
without any additional HTTP overhead.
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