[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:
@@ -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)>) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user