Skip to content

Fix auto mode button states and RX logging subscription behavior#163

Merged
MrAlders0n merged 4 commits into
devfrom
copilot/fix-auto-mode-button-issues
Dec 30, 2025
Merged

Fix auto mode button states and RX logging subscription behavior#163
MrAlders0n merged 4 commits into
devfrom
copilot/fix-auto-mode-button-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 30, 2025

After merging PRs #161 and #162, three issues emerged: RX Auto button stayed disabled after stopping TX/RX Auto, TX/RX Auto button wasn't blocked when RX Auto was active, and RX Log collected observations even when auto modes were OFF.

Changes

Button state management

  • Added updateControlsForCooldown() calls in all four auto mode start/stop functions to properly enforce mutual exclusion
  • Existing logic in updateControlsForCooldown() already implements correct button state rules; it just wasn't being invoked at transition points

RX logging subscription check

  • Added early return in handlePassiveRxLogging() when rxSubscription.mode is null or 'txPing'
  • Observations now only logged when mode is 'txRxAuto' or 'rxAuto'
// handlePassiveRxLogging() - new check at function start
if (!rxSubscription.mode || rxSubscription.mode === 'txPing') {
  debugLog(`[PASSIVE RX] No RX subscription active or manual ping mode - skipping observation`);
  return;
}

Behavior After Fix

Mode TX/RX Auto Button RX Auto Button Passive RX Logging
Idle Enabled Enabled OFF
TX/RX Auto ON Active Disabled ON
RX Auto ON Disabled Active ON
Manual TX Ping Enabled Enabled OFF (echo only)

Impact: Proper button mutual exclusion, no unwanted RX processing when idle, reduced battery/memory usage.

Original prompt

Problem Statement: Auto Mode Button State and RX Logging Issues

Context

Following the merge of PRs #161 (Map Refresh Optimization) and #162 (Haversine Distance Fix) in the dev branch, there are three critical issues with the Auto mode button states and RX observation logging behavior.

Issues to Fix

1. RX Auto Button Remains Disabled After Stopping Auto Mode

Current Behavior:

  • After stopping TX/RX Auto mode, the RX Auto mode button remains disabled/blocked
  • Users cannot click RX Auto mode even after TX/RX Auto mode has been fully stopped

Expected Behavior:

  • When TX/RX Auto mode is stopped, RX Auto mode button should become enabled and clickable
  • Only one auto mode should be active at a time, but when neither is active, both buttons should be available

2. TX/RX Auto Button Not Blocked When RX Auto Is Active

Current Behavior:

  • When RX Auto mode is ON, users can still click the TX/RX Auto button
  • This allows both auto modes to be active simultaneously (invalid state)

Expected Behavior:

  • When RX Auto mode is ON, the TX/RX Auto button should be disabled/blocked
  • When TX/RX Auto mode is ON, the RX Auto button should be disabled/blocked
  • Mutual exclusion: Only TX/RX Auto OR RX Auto should be clickable if the other is not active

3. RX Log Collecting Observations When Auto Mode Is OFF

Current Behavior:

  • The RX Log continues to show/collect observations even when auto modes (TX/RX Auto and RX Auto) are OFF
  • Background listening services are capturing and logging heard packets regardless of auto mode state

Expected Behavior:

  • RX Log should ONLY collect and display observations when TX/RX Auto OR RX Auto mode is enabled
  • When auto modes are OFF, heard packets should be ignored completely:
    • Do NOT log them to RX Log
    • Do NOT queue them for API submission
    • Background listening services should continue running but not process/store the heard packets
  • TX/RX Auto and RX Auto should only subscribe to RX listening data when their respective modes are enabled

Files Likely Affected

Based on the codebase structure:

  • content/wardrive.js - Auto mode button state management and RX listening logic
  • Button state update functions (updateAutoButton(), enableControls(), updateControlsForCooldown())
  • RX listening service and observation collection logic
  • Auto mode start/stop functions (startAutoPing(), stopAutoPing())

Acceptance Criteria

  1. ✅ Stopping TX/RX Auto mode enables the RX Auto button
  2. ✅ Starting RX Auto mode disables the TX/RX Auto button
  3. ✅ Starting TX/RX Auto mode disables the RX Auto button
  4. ✅ Stopping either auto mode enables the other button
  5. ✅ RX Log only shows observations when TX/RX Auto OR RX Auto is active
  6. ✅ Heard packets are ignored (not logged, not queued) when both auto modes are OFF

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits December 30, 2025 12:15
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix auto mode button state and RX logging issues Fix auto mode button states and RX logging subscription behavior Dec 30, 2025
Copilot AI requested a review from MrAlders0n December 30, 2025 12:24
@MrAlders0n MrAlders0n marked this pull request as ready for review December 30, 2025 12:28
Copilot AI review requested due to automatic review settings December 30, 2025 12:28
@MrAlders0n MrAlders0n merged commit ae92ced into dev Dec 30, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes three critical issues that emerged after merging PRs #161 and #162: RX Auto button remaining disabled after stopping TX/RX Auto, TX/RX Auto button not being blocked when RX Auto is active, and RX Log collecting observations even when auto modes are OFF.

Key changes:

  • Added updateControlsForCooldown() calls at all four auto mode start/stop transition points to ensure proper button mutual exclusion
  • Added subscription mode check in handlePassiveRxLogging() to prevent passive RX logging when auto modes are OFF

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MrAlders0n MrAlders0n deleted the copilot/fix-auto-mode-button-issues branch December 31, 2025 15:58
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.

3 participants