fix: ensure coder user accounts are always activated before use#322
fix: ensure coder user accounts are always activated before use#322
Conversation
Coder marks accounts as dormant after inactivity, which can break workspace and submission flows. Extract shared ensureUserActive() helper and call it in both launchWorkspace and triggerSubmission.
Greptile SummaryThis PR centralizes Coder user-account activation by extracting an
Confidence Score: 4/5
Important Files Changed
Prompt To Fix All With AIThis is a comment left during a code review.
Path: packages/backend/convex/web/assignmentActions.ts
Line: 89
Comment:
**Behavioral change: activation failures now throw**
The original code explicitly silenced activation errors with `// Don't throw here - continue with workspace launch even if activation fails`. The new `ensureUserActive` call will now throw and abort the entire `launchWorkspace` action if the Coder activation endpoint fails. This is almost certainly the intended improvement (the PR description says "always activated before use"), but it's worth confirming this trade-off is acceptable — workspace launches that previously succeeded despite a dormant-activation failure will now surface as errors to the caller.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix: ensure coder user accounts are alwa..." | Re-trigger Greptile |
| if (activateResp.error) { | ||
| // Don't throw here - continue with workspace launch even if activation fails | ||
| } | ||
| await ensureUserActive({ client: coderClient, userId: coderUserId }); |
There was a problem hiding this comment.
Behavioral change: activation failures now throw
The original code explicitly silenced activation errors with // Don't throw here - continue with workspace launch even if activation fails. The new ensureUserActive call will now throw and abort the entire launchWorkspace action if the Coder activation endpoint fails. This is almost certainly the intended improvement (the PR description says "always activated before use"), but it's worth confirming this trade-off is acceptable — workspace launches that previously succeeded despite a dormant-activation failure will now surface as errors to the caller.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/backend/convex/web/assignmentActions.ts
Line: 89
Comment:
**Behavioral change: activation failures now throw**
The original code explicitly silenced activation errors with `// Don't throw here - continue with workspace launch even if activation fails`. The new `ensureUserActive` call will now throw and abort the entire `launchWorkspace` action if the Coder activation endpoint fails. This is almost certainly the intended improvement (the PR description says "always activated before use"), but it's worth confirming this trade-off is acceptable — workspace launches that previously succeeded despite a dormant-activation failure will now surface as errors to the caller.
How can I resolve this? If you propose a fix, please make it concise.
Create a helper function that can be wrapped around coder interactions to make sure user account is always active before doing the action