Fix ping controls unlocking prematurely before API post completes#88
Merged
MrAlders0n merged 4 commits intodevfrom Dec 20, 2025
Merged
Conversation
- Add state.pingInProgress flag to track full ping lifecycle - Lock ping controls when ping operation starts (after validation) - Unlock controls only after API post completes in postApiAndRefreshMap - Add unlock logic for error paths and edge cases - Add debug logging for control lock/unlock events - Ensure controls remain locked during: ping send, RX listening, finalizing repeats, and API posting Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
- Add details about control locking during entire ping lifecycle - Document when controls lock/unlock relative to API posting - Clarify that controls remain locked through all phases including API post Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
- Create unlockPingControls(reason) helper to eliminate code duplication - Remove redundant pingInProgress variable in updateControlsForCooldown - Use helper function in all unlock paths for consistency - Improves maintainability and ensures consistent behavior Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update debug logging guidelines for MeshCore GOME WarDriver
Fix ping controls unlocking prematurely before API post completes
Dec 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Send Ping" and "Start Auto Ping" buttons unlock during the "Finalizing heard repeats" phase, before API posting completes. This allows users to trigger overlapping pings, causing timer desync and state inconsistency.
Root Cause
The 7-second cooldown timer expires when RX listening completes, but API posting happens after with an additional 3+ second delay. Controls unlock too early.
Changes
state.pingInProgressflag to track full ping lifecycle independently of cooldown timersendPing(), before mesh transmissionpostApiAndRefreshMap(), or on error pathsunlockPingControls(reason)helper to eliminate duplication across unlock pathsupdateControlsForCooldown()to check both cooldown timer ANDpingInProgressflagBehavior
Controls now remain locked for entire sequence:
The existing cooldown timer continues to function as before; the new flag provides lifecycle-based locking on top of time-based cooldown.
Documentation
Updated
CONNECTION_WORKFLOW.mdto document control locking behavior during ping operations.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.