Skip to content

Fix RX going dead after ~60 minutes - #358

Open
Mattzi wants to merge 1 commit into
pierr3:mainfrom
Mattzi:fix/rx-dead-after-60min
Open

Fix RX going dead after ~60 minutes#358
Mattzi wants to merge 1 commit into
pierr3:mainfrom
Mattzi:fix/rx-dead-after-60min

Conversation

@Mattzi

@Mattzi Mattzi commented Jul 27, 2026

Copy link
Copy Markdown

This can also be done by yourself, just adding it here for completeliness purposes. Check afv-native for most changes

What

Reported against 1.4.0-beta.7: after roughly an hour of a session, TX
kept working but RX went completely silent, with nothing recoverable
short of an in-app reconnect.

Traced from a full session log: the hourly JWT refresh POST hung with no
callback ever firing, which left the AFV API session stuck in
Reconnecting permanently. The old token expired shortly after, transceiver
updates started coming back 401, the server dropped the client's
transceiver registration, and RX died while TX kept working over the
already-established voice channel.

Context

Part of the conditions for this were introduced by my previous PR (the
libcurl.dll crash fix). That PR corrected doAsync() to actually call
shareState() on the request - previously a no-op bug - which had the side
effect of making the CURL share handle live across threads for the first
time. That share handle was never given the lock callbacks libcurl
requires for cross-thread use, which is the most likely source of the
stalled request behind this bug. So this is best read as finishing what
that PR started, not a fully separate issue.

Changes

Bumps the afv-native submodule to pick up:

  • Timeouts on every HTTP request, so a stalled transfer can't hang forever
  • The missing share-handle lock callbacks
  • A token refresh that retries with backoff instead of silently hanging
    or tearing down a live session on a single failed attempt

Also bumps the app version to 1.4.0-beta.8 and refreshes
backend/package-lock.json's stale engines field.

Testing

Typecheck, lint and full native build all pass. Packaged and installed
locally

Again: this is a claude written description

@pierr3

The hourly JWT refresh POST could be submitted and then never complete -
no success callback, no error callback. Since mRefreshTokenTimer is only
re-armed inside _authenticationCallback, that left APISession stuck in
Reconnecting permanently with no retry. The old token expired a minute
later, transceiver updates started returning 401, the server dropped the
client's transceiver registration, and RX went dead while TX kept working
over the already-established UDP channel. Only a manual reconnect
recovered it.

Fixed in afv-native (see submodule): curl connect/transfer timeouts so a
stalled request cannot hang forever, the share-handle lock callbacks
libcurl requires for cross-thread use, and a refresh that retries with
backoff while the token still has runway instead of either hanging
silently or tearing down a live session.

Also updates backend/package-lock engines, which was stale against
backend/package.json, and the trackaudio-afv tarball integrity for the
rebuilt native module.

Note that pnpm install rewrites the trackaudio-afv specifier with Windows
path separators when the backend is built on Windows. Kept as forward
slashes here so the Linux and macOS CI builds still resolve it.
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.

1 participant