Skip to content

Conversation

@prathamesh-sonpatki
Copy link
Member

  • Added DoRequestWithTokenRefresh wrapper that automatically retries requests with refreshed token on 401/403 errors
  • Added TokenMutex to Config for thread-safe token updates
  • Updated all API functions to use pointer to Config and automatic token refresh
  • Fixed FetchPhysicalIndex error message to properly read response body

This ensures expired access tokens are automatically refreshed using the refresh token, preventing 403 errors from expired credentials.

🤖 Generated with Claude Code

prathamesh-sonpatki and others added 3 commits October 20, 2025 12:18
- Added DoRequestWithTokenRefresh wrapper that automatically retries requests with refreshed token on 401/403 errors
- Added TokenMutex to Config for thread-safe token updates
- Updated all API functions to use pointer to Config and automatic token refresh
- Fixed FetchPhysicalIndex error message to properly read response body

This ensures expired access tokens are automatically refreshed using the refresh token, preventing 403 errors from expired credentials.

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

Co-Authored-By: Claude <[email protected]>
- Created MockLast9Server for testing entire MCP server with mock data
- Added integration tests for:
  - Token refresh on 401/403 errors
  - Concurrent token refresh handling
  - Various MCP tools with mock responses
  - Error handling scenarios
- Added GitHub Actions workflow for:
  - Unit tests with race detection and coverage
  - Integration tests
  - Linting with golangci-lint
  - Build verification
- All tests use mock HTTP server, no real credentials needed

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

Co-Authored-By: Claude <[email protected]>
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.

1 participant