Skip to content

Conversation

@szporwolik
Copy link
Contributor

@szporwolik szporwolik commented Nov 5, 2025

Summary

Refactored DX Waterfall from bidirectional coupling (form ↔ radio ↔ waterfall) to unidirectional data flow (Radio → CAT → catState → Waterfall/Form), eliminating race conditions and simplifying the codebase.

This shall address:

Problem Statement

The original implementation had bidirectional coupling between form, radio, and waterfall components, causing:

  • Race conditions when form and CAT tried to update simultaneously
  • Band selector changes triggering unwanted radio frequency updates
  • Form changes affecting waterfall display during CAT updates

Solution

Implemented unidirectional data flow with radio as the single source of truth:

Radio → CAT updates → window.catState → Waterfall reads catState
↓
Form reads catState (display only)

@phl0
Copy link
Contributor

phl0 commented Nov 5, 2025

You may want to change the base branch to dev here?

@szporwolik szporwolik changed the base branch from master to dev November 5, 2025 19:54
@szporwolik szporwolik mentioned this pull request Nov 5, 2025
38 tasks
@int2001
Copy link
Contributor

int2001 commented Nov 6, 2025

just checked this from user-perspective in a quick-run. things found so far:

  • ❌ The "Recheck if wked/cnfmd" doesn't trigger on Bandchange. only on mode-change (QSO-Form / no matter if CAT enabled or not)
  • ❌ Manual QSY to other Band (on TRX) still triggers back to radio (At Radio doing: 40m LSB -> 20m -> FM // instant overwrite of FM to USB at radio via CAT) // my fault: was running two different instances in 2 browser-windows. this one seems to be solved.
  • ✅ Manual QSY to other Band (on TRX) doesn't triggers back to radio, Frequency/Mode is written to form
  • ✅ Changing Band at Form doesn't trigger CAT (good!)
  • ✅ Changing Band (form or cat) doesn't empty qso-form (good!)

Copy link
Contributor

@phl0 phl0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested various stations on different bands (without CAT-controlled TRX) and could not spot any issues.

Copy link
Contributor

@phl0 phl0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After carefully re-checking with @int2001 I can confirm his issue. Preparing a log and changing band does not update wkd/not wkd status where as mode change does.

@szporwolik
Copy link
Contributor Author

Mentioned issue was fixed, but... the code was massively refactored - some of the code was moved to radiohelpers.js , some to common.js for reuse and the whole logic was changed to state machine. 2nd change will significantly improve or even solve most of the possible race conditions. It's more predictable than initial PR and - most important - it shall be much easier to maintain and understood.

Downside - again, massive piece of code for the review. 😞

Important Note

As the code was refactored in all possible aspects, please consider it UNTESTED - whatever was tested/was working in the past, may not be working now and new bugs might be introduced. I tried my best to test it, but it's massive piece of code.
In addition, we have 2 major paths - no CAT and with CAT, both are different, so I would recommend to test both.

@szporwolik szporwolik marked this pull request as ready for review November 7, 2025 19:41
@AndreasK79 AndreasK79 merged commit e4d1b80 into wavelog:dev Nov 10, 2025
AndreasK79 added a commit that referenced this pull request Nov 10, 2025
@szporwolik szporwolik deleted the dev_dx_waterfall_fixes branch November 16, 2025 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants