Fix RX going dead after ~60 minutes - #358
Open
Mattzi wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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