Skip to content

Profile-load hardening: follow-up tidy-ups from #3563 review #3572

@ten9876

Description

@ten9876

Non-blocking follow-ups deferred from the #3563 review (merged as 3266fe35). The core hardening is correct and shipped; these are cleanups + one confirmation.

1. Confirm the suppressed-write callback code is never surfaced as a user error

During a profile-load write-hold, suppressed profile-owned writes invoke the callback with a failure-looking code:

cb(0x50000061, QStringLiteral("suppressed during profile load"));  // RadioModel.cpp

while the function itself returns 0 (success). These are fire-and-forget slice/pan/display writes, so it almost certainly never reaches the user — but we should confirm no sendCommand callback path treats 0x50000061 as a user-visible error/toast or triggers a retry during profile recall. If any does, suppress this code there or use a benign sentinel.

2. De-duplicate profileLoadMayRebuildRadioTopology

It's defined twice — inline in src/models/ProfileLoadCommand.h (type == "global") and again in src/gui/MainWindow_Wiring.cpp's anonymous namespace (case-insensitive compare). No ODR clash today and they agree (type is pre-lowercased), but it's two sources of truth for the same rule — if "topology profile" ever broadens past global, one copy can drift. Have MainWindow_Wiring.cpp include the header and drop its local copy.

3. Consolidate the write-hold duration constant

kProfileLoadStateWriteHoldMs = 10000 is duplicated in three places (RadioModel.cpp file scope + two local constexpr in MainWindow_Wiring.cpp), and the recovery flush/reacquire timers (11000 / 11250 ms) are implicitly tuned to outlast that 10 s hold. If someone shortens the hold, those timers won't track it. Hoist to a single shared constant (or at minimum comment the timer sites noting the dependency on the hold duration).

4. (Minor) Recovery cascade uses uncancelable singleShot timers

The recovery passes are a set of uncancelable QTimer::singleShot lambdas (350/1200/1500/2500/3500/11000/11250 ms). Each guards on m_shuttingDown/isConnected, so back-to-back profile loads are safe but stack redundant timers. Fine as-is; worth revisiting only if rapid profile recall becomes a real workload.


Source: #3563 review (two aethersdr-agent passes + Copilot + maintainer review). None of these block; grouping them so they don't get lost.

Metadata

Metadata

Assignees

Labels

GUIUser interfaceenhancementImprovement to existing featuregood first issueGood for newcomersmaintainer-reviewRequires maintainer review before any action is takenpriority: lowLow priorityprotocolSmartSDR protocol

Type

No type
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