fix: remote mobilenext.ai device allocation response change - #309
Conversation
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughFleet allocation responses and RPC parameters were converted to typed structures. Remote device retrieval now uses allocation-based lookup, and device providers serialize 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cli/remote.go`:
- Around line 94-96: Update waitForAllocation so the immediate non-allocating
path populates result.Device before returning. Retrieve the device details using
the existing allocation response identifiers and preserve the current
wait/polling behavior for responses that are still allocating.
In `@commands/remote.go`:
- Around line 76-91: Update FetchRemoteDevices to determine whether the provider
field is absent from the raw device payload, rather than relying on
ProviderType() being empty. Only call SetProvider("mobilenext") when no provider
object exists; preserve an existing provider object and its AllocationID even
when its type is missing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: eb4da2fe-eb5d-4f4d-ba6f-63512554b3f7
📒 Files selected for processing (5)
cli/fleet.gocli/remote.gocommands/remote.gocommands/remote_test.godevices/common.go
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cli/devices.go`:
- Line 26: Update the token acquisition in the devices command around
getRemoteToken so its error is not discarded. Propagate unexpected acquisition
failures to the caller, while explicitly handling only the intended
unauthenticated local-only case; do not invoke commands.DevicesCommand with an
empty token when keyring or other errors occur.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: eba83a3a-bbff-4826-a34c-47ce6abdaab4
📒 Files selected for processing (5)
cli/devices.gocli/flags.gocli/fleet.gocli/remote.gocommands/remote.go
💤 Files with no reviewable changes (1)
- cli/fleet.go
🚧 Files skipped from review as they are similar to previous changes (2)
- cli/remote.go
- commands/remote.go
| } | ||
|
|
||
| token, _ := getFleetToken() | ||
| token, _ := getRemoteToken() |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Do not discard remote-token acquisition errors.
Line 26 ignores errors from getRemoteToken(). Passing an empty token makes commands.DevicesCommand skip remote fetching and return success, silently omitting remote devices—even for keyring or other unexpected failures. Propagate the error, or explicitly handle only the intended unauthenticated local-only case.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@cli/devices.go` at line 26, Update the token acquisition in the devices
command around getRemoteToken so its error is not discarded. Propagate
unexpected acquisition failures to the caller, while explicitly handling only
the intended unauthenticated local-only case; do not invoke
commands.DevicesCommand with an empty token when keyring or other errors occur.
Summary by CodeRabbit
New Features
Bug Fixes