Skip to content

1.4.0 Merge#91

Merged
MrAlders0n merged 61 commits intomainfrom
dev
Dec 20, 2025
Merged

1.4.0 Merge#91
MrAlders0n merged 61 commits intomainfrom
dev

Conversation

@MrAlders0n
Copy link
Collaborator

@MrAlders0n MrAlders0n commented Dec 20, 2025

Title: Release v1.4.0 - Capacity Management & Enhanced Connection Flow
Description:
Summary

This release introduces a comprehensive capacity management system, improved connection flow, and better user feedback through granular status messages.
Key Changes

🔐 Capacity Management

New checkCapacity() function integrates with MeshMapper's capacitycheck.php API
Fail-closed behavior on connect (denies connection if API unavailable)
Fail-open behavior on disconnect (always releases slot)
Real-time slot revocation detection during active wardriving sessions

📊 Version Tracking

APP_VERSION constant injected at build time via GitHub Actions
Version included in API payloads for analytics/debugging

🔄 Connection Flow Improvements

Capacity check now occurs BEFORE channel/GPS setup
Prevents wasted setup work when slots are unavailable
Connection remains at "Connecting" until fully complete (no premature "Connected")

💬 Status Message Enhancements

13 new granular status messages added
Context-specific disconnect error messages
Status messages for each connection phase

🐛 Bug Fixes

Ping controls now properly lock during entire ping lifecycle
Status message ordering corrected for disconnect flows
Slot revocation response parsing fixed

📚 Documentation

New docs/CONNECTION_WORKFLOW.md - comprehensive workflow documentation
New docs/DEVELOPMENT_REQUIREMENTS.md - coding standards
Updated docs/STATUS_MESSAGES.md - all status messages catalogued

Files Changed

.github/workflows/deploy.yml - Version injection for DEV and release builds
content/wardrive.js - Main application logic (~300 lines added)
docs/CONNECTION_WORKFLOW.md - New documentation (569 lines)
docs/DEVELOPMENT_REQUIREMENTS.md - New documentation
docs/STATUS_MESSAGES.md - Moved and expanded

Testing Notes

Test capacity check with valid/invalid API responses
Test slot revocation by revoking slot during active session
Verify status message sequence during connect/disconnect
Confirm ping controls remain locked until API post completes

Copilot AI and others added 30 commits December 20, 2025 01:44
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…ility-check

Implement slot availability check for wardriving throttle
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…plete

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Change capacity check from fail-open to fail-closed and improve status messages
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>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…guidelines

Fix connection status message timing and preserve error states during disconnect
- Modified postToMeshMapperAPI() to check 'allowed' field on every POST
- Added debug logging when allowed === true (device still has active slot)
- Changed disconnect behavior when allowed === false to use new status message
- Updated status message from 'capacity' to 'slot has been revoked'
- Added new disconnectReason 'slot_revoked' for tracking
- Updated STATUS_MESSAGES.md with new status message documentation

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…uidelines

Implement slot revocation check on API responses
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>
Fix slot revocation check to parse API response regardless of HTTP status
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…ection-documentation

Add comprehensive connection/disconnection workflow documentation
Copilot AI and others added 29 commits December 20, 2025 04:06
… GPS init

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…dards

Reorder connection flow: check capacity before channel/GPS setup
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…tribute

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…elines-again

Add build-time app version to MeshMapper API payload
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…dards-again

Add granular status messages for connection flow and fix slot revocation disconnect sequence
…sages

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…uidelines-again

Fix status message ordering in capacity check failure flow
- 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>
…uidelines-another-one

Fix ping controls unlocking prematurely before API post completes
Remove setStatus("Disconnected") from final else block in disconnected event handler.
This was causing the terminal error messages (capacity_full, app_down) to be overwritten.
Added comprehensive debug logging to track disconnect reason and code paths.

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Replace generic "error" disconnect reason with specific reasons:
- "public_key_error": When device public key is invalid or missing
- "channel_setup_error": When channel setup or GPS initialization fails
- "ble_disconnect_error": When BLE disconnect operation fails

Each error now displays a specific terminal status message in the disconnected
event handler, following the same pattern as capacity_full, app_down, and slot_revoked.

The else block now shows generic "Disconnected" message for truly unknown reasons
instead of trying to preserve non-existent status messages.

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
- Clarify disconnect delay comment to explain it ensures "Acquiring wardriving slot"
  status is visible before "Disconnecting" appears
- Add comments to explain intentional duplicate clearing of error messages
  (in handler for immediate cleanup, in general cleanup as safety net)

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
…ering

Fix status message ordering in disconnect flows
All "Disconnected" status messages now bypass the 500ms minimum visibility
enforcement by passing `immediate: true` as the third parameter to setStatus.
This ensures disconnected messages appear immediately without delay, fixing
the issue where messages were queued with 445ms delays.

Co-authored-by: MrAlders0n <55921894+MrAlders0n@users.noreply.github.com>
Fix disconnected messages being queued instead of showing immediately
@MrAlders0n MrAlders0n merged commit e413d44 into main Dec 20, 2025
1 check passed
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.

2 participants