Skip to content

Conversation

@takaokouji
Copy link

This PR addresses tasks (2) and (3) of issue scratchfoundation#471.

  • improved RSSI calculation based on remaining time until expiration.
  • improved disconnection handling by forwarding event arguments and early cleanup.
  • Added unit tests for RSSI calculation.

Related issue: smalruby/smalruby3-gui#471

takaokouji and others added 6 commits December 28, 2025 16:49
- Implement calculateRssi method using 3000s max connection time constant.
- Update scan() to calculate RSSI for discovered groups.
- Add unit tests for calculateRssi.
- Task (3) of issue scratchfoundation#471.

Co-Authored-By: Gemini <noreply@google.com>
- Forward arguments for PERIPHERAL_CONNECTED/DISCONNECTED in VM.
- Call cleanupAndDisconnect() early in leaveGroup().
- Pass extensionId when emitting DISCONNECTED.
- Task (2) of issue scratchfoundation#471.

Co-Authored-By: Gemini <noreply@google.com>
- Update RSSI calculation to use MESH_MAX_CONNECTION_TIME_SECONDS environment variable
- Add test case for custom environment variable in calculateRssi
- Default to 3000 seconds if environment variable is not set

Co-Authored-By: Gemini <noreply@google.com>
- Add shouldDisconnectOnError helper to check for critical connection errors
- Use GraphQL errorType (GroupNotFound, Unauthorized, NodeNotFound) for detection
- Fallback to message string matching for backward compatibility
- Ensure immediate disconnection on heartbeat, data, or event failure if connection is invalid
- Add comprehensive unit tests for error handling logic

Co-Authored-By: Gemini <noreply@google.com>
- Add client-side filtering for expired groups in scan() method
- Ensure only groups with a valid future expiresAt are listed
- Update unit test to verify expired group filtering

Co-Authored-By: Gemini <noreply@google.com>
- Remove debug logs added for RSSI investigation
- Keep expired group filtering log for troubleshooting
- Clean up calculateRssi, createGroup, renewHeartbeat, and scan logs

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@takaokouji takaokouji merged commit f5b57bb into develop Dec 28, 2025
1 check passed
@takaokouji takaokouji deleted the fix/issue-471-mesh-v2-improvements branch December 28, 2025 15:42
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