Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 3, 2025

This PR addresses persistent ETIMEDOUT connection failures that occur after approximately 24 hours of plugin operation. The issue manifests as:

[August] [DEBUG] Lock: DoorName failed (refreshStatus) lockDetails, Error: {"errno":-110,"code":"ETIMEDOUT","syscall":"read"}
[August] Lock: DoorName pushChanges: read ETIMEDOUT

Root Cause

The August API invalidates sessions after extended periods, but the plugin continued using stale connections without attempting to re-establish them when timeouts occurred.

Solution

Implemented a minimal timeout detection and session refresh mechanism:

  1. Timeout Detection: Added isTimeoutError() method to specifically identify ETIMEDOUT errors in network operations
  2. Session Refresh: Added refreshAugustSession() method that calls augustConfig.end() to clear stale tokens, forcing re-authentication on the next API call
  3. Retry Logic: Enhanced refreshStatus() and pushChanges() methods to automatically retry operations once after session refresh when timeouts are detected

Technical Details

The fix leverages the existing august-yale library's session management:

  • Uses augustConfig.end() to clear stale tokens
  • Allows automatic re-authentication on subsequent API calls
  • Implements single retry to avoid infinite loops
  • Preserves all existing error logging and debugging

Testing

  • ✅ Build passes without compilation errors
  • ✅ All existing tests continue to pass
  • ✅ Linting requirements satisfied
  • ✅ No breaking changes to existing functionality

The solution is minimal and surgical, adding only 64 lines of code focused specifically on timeout handling without modifying any existing behavior.

Fixes #126.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@donavanbecker donavanbecker changed the base branch from latest to beta-3.0.3 September 3, 2025 12:00
@Copilot Copilot AI changed the title [WIP] Bug: Lock: DoorName failed (refreshStatus) lockDetails, Error: {"errno":-110,"code":"ETIMEDOUT","syscall":"read"} Fix August API ETIMEDOUT errors after 24 hours with session refresh and retry logic Sep 3, 2025
@donavanbecker donavanbecker marked this pull request as ready for review September 3, 2025 12:10
@Copilot Copilot AI requested a review from donavanbecker September 3, 2025 12:10
Copilot finished work on behalf of donavanbecker September 3, 2025 12:10
@github-actions github-actions bot added enhancement New feature or request beta fix labels Sep 3, 2025
@donavanbecker donavanbecker merged commit bf10832 into beta-3.0.3 Sep 3, 2025
7 checks passed
@donavanbecker donavanbecker deleted the copilot/fix-126 branch September 3, 2025 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta enhancement New feature or request fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Lock: DoorName failed (refreshStatus) lockDetails, Error: {"errno":-110,"code":"ETIMEDOUT","syscall":"read"}
2 participants