-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't workingdashboardDashboard/platform relatedDashboard/platform related
Description
Problem
OAuth device flow implementation (Issue #3) is complete, but tests are failing due to mock configuration issues.
Current Status
Implementation: ✅ Complete
- Device authorization logic
- Token polling with exponential backoff
- Error handling for all edge cases
Tests: ❌ 3/6 failing
Failing Tests
-
pollForAccessTokenreturns access token when authorization is granted- Symptom: Test times out
- Cause:
axios.postmock stuck inpendingstate, never progresses to success
-
Error handling for non-retryable errors
- Symptom: Promise resolves instead of rejecting
- Cause:
invalid_granterror handling logic not terminating correctly
-
pollForAccessTokenhandlesslow_down- Symptom: Delay logic not triggering
- Cause: Mock not simulating
slow_downresponse correctly
Root Cause
axios.post mock sequences not configured to simulate sequential polling flow:
- Expected:
pending→pending→success - Actual: Stuck in
pending, never resolves
Additional Issues
- Jest reports open handles (unclosed timers/async code)
- Test framework may need configuration to detect/close handles properly
Next Steps
- Debug
axios.postmock implementation in test file - Ensure sequential responses work correctly for all test cases
- Verify all promises resolve/reject as expected
- Fix Jest open handles
- Run
npm testto verify 6/6 passing
Files
- Implementation:
backend/src/oauth/oauth-client.js - Tests:
backend/src/oauth/oauth-client.test.js
Priority
Medium - Implementation is functional, tests validate correctness but aren't blocking OAuth flow usage.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdashboardDashboard/platform relatedDashboard/platform related