Skip to content

TCI DAX routing: clear channel→TRX cache on disconnect teardown + add onDaxAudioReady routing test (follow-up to #3759) #3766

Description

@ten9876

Fast-follow to #3759 (DAX RX audio routing cache). Two items the review flagged, neither blocking the merged fix.

1. Clear the routing cache on the disconnect-teardown path

#3759 added m_channelTrx (the channel→TRX routing cache) and clears it in rearmDaxForProfileLoad() and releaseDaxForTci() — but not in the third teardown path: the connectionStateChanged(false) disconnect handler (TciServer.cpp ~lines 219–227), which already clears the three sibling maps (m_tciDaxStreamIds, m_tciDaxBorrowedChannels, m_tciDaxSlices).

By the PR's own invariant — "routing cache stale once the channel→stream map is torn down" — this path should clear it too. On a disconnect→reconnect where the slice topology differs, the cached channel→trx (a slice index) can be stale and consulted for the transient window before the first dax!=0 re-resolves. Low impact (self-heals; channels bounded 1–4), but it's an inconsistency: 2 of the 3 identical teardown sites were handled.

Fix: add m_channelTrx.clear(); alongside the sibling clears in the disconnect handler. One line.

2. No test covers onDaxAudioReady routing

There's no unit test for the DAX channel→TRX routing in onDaxAudioReady (noted in the PR). A focused test for the multi-receiver fallback (scan-miss → cached trx vs cold-start channel-1) would lock in the #3669 behavior and catch regressions. Larger than item 1; can be its own change.

Scope: src/core/TciServer.cpp. Refs #3759, #3669.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    audioAudio engine and streamingbugSomething isn't workingenhancementImprovement to existing featuremaintainer-reviewRequires maintainer review before any action is takenpriority: lowLow priorityprotocolSmartSDR protocol

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions