Skip to content

Retry Linux connections promptly after network recovery or resume - #45

Merged
itz4blitz merged 1 commit into
itz4blitz:mainfrom
vbmithr:fix/linux-reconnect-recovery
Oct 18, 2026
Merged

itz4blitz merged 1 commit into
itz4blitz:mainfrom
vbmithr:fix/linux-reconnect-recovery

Conversation

@vbmithr

@vbmithr vbmithr commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

After suspend or a local network outage, chatd could remain offline for minutes even after networking returned: shared reconnect backoff grew to 15 minutes and no recovery event interrupted the wait.

On Linux, wake that wait on GIO network-availability/configuration hints or login1 resume signals, reset accumulated backoff, and retry promptly. GIO supports netlink without NetworkManager. A single GLib event thread serves all accounts; the added Linux-only Rust dependency already exists in the lockfile.

Recovery hints remain hints: they do not mark accounts Connected, close healthy connections, revive expired sessions, or bypass ordinary HTTP/command pacing. Attempts stay at least one second apart, including event bursts, and continued failures still back off. Other platforms retain timed reconnection; remote DNS/service recovery with no local OS event is not detected by this change.

Includes docs/reconnecting.md with behavior, limitations, restart instructions, and repeatable tests.

Validation:

  • Daemon unit suite with member changes: 137 passed, 1 manual namespace test ignored.
  • Independent clean checkout of the original fix: 134 passed, 1 ignored.
  • Real kernel route notification through GIO's netlink backend passed in a disposable network namespace, with host networking untouched and no NetworkManager required.
  • Synthetic real-daemon integration suites: Discord 31 passed (4 manual audit tests ignored), Signal 10, Slack 15, Teams 7, Messages 5.
  • Arch package revision 13 built successfully.
  • Rechecked daemon unit tests after applying the commit to current main.

Fixes #41. The Discord viewport-reconciliation findings in #42/#43 and subscription-budget finding in #44 are separate.

Wake shared reconnect backoff on GIO connectivity hints and login1
resume signals, without requiring NetworkManager. Retain a one-second
attempt floor, ordinary command pacing and continued-failure backoff.
Cover interrupted waits and real netlink recovery in isolated tests,
and document the Linux recovery behavior and platform limits.

Co-Authored-By: GPT-6 <noreply@openai.com>
@vbmithr
vbmithr requested a review from itz4blitz as a code owner October 18, 2026 16:37

@itz4blitz itz4blitz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux reconnect waits now wake on GIO network-available and login1 resume, reset backoff, and still keep a one-second floor so hint bursts cannot storm. Hints do not mark an account connected, close a healthy socket, or revive an expired session. The Windows failure was a_call_that_moves_to_another_voice_server_keeps_its_devices_and_goes_on seeing 5 packets instead of 15; that test is in mediad and this branch does not touch it. A rerun of the failed job passed.

@itz4blitz
itz4blitz merged commit 8ab0882 into itz4blitz:main Oct 18, 2026
11 of 12 checks passed
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.

Retry promptly after suspend or network recovery instead of waiting out reconnect backoff

2 participants