[fix](trx-server): clear CW history on ResetCwDecoder

ResetCwDecoder already bumped cw_decode_reset_seq but omitted the
history flush that APRS, FT8, and WSPR all perform.  Wire
clear_cw_history() into the handler to match the pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-07 10:17:39 +01:00
parent cbf3301664
commit b4fb42dba4
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -282,6 +282,10 @@ impl DecoderHistories {
h.iter().map(|(_, evt)| evt.clone()).collect()
}
pub fn clear_cw_history(&self) {
self.cw.lock().expect("cw history mutex poisoned").clear();
}
// --- FT8 ---
fn prune_ft8(history: &mut VecDeque<(Instant, Ft8Message)>) {
+1
View File
@@ -437,6 +437,7 @@ async fn process_command(
return snapshot_from(ctx.state);
}
RigCommand::ResetCwDecoder => {
ctx.histories.clear_cw_history();
ctx.state.cw_decode_reset_seq += 1;
let _ = ctx.state_tx.send(ctx.state.clone());
return snapshot_from(ctx.state);