fix: ensure Apollo client is rebuilt after configuration update in rollback command (csdx launch: rollback) - #210
Merged
Merged
Conversation
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
…llback command (csdx launch:rollback) - Added a call to prepareApiClients() after getConfig() to ensure the Apollo client has the correct project and organization headers based on the latest configuration.
AryanBansal-launch
force-pushed
the
cl-4859
branch
from
July 27, 2026 17:27
58d8940 to
9d9822b
Compare
Harshi-Shah-CS
approved these changes
Jul 27, 2026
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
chhavi-mandowara-cstk
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
launch.PROJECT.NOT_FOUNDerrors when runningcsdx launch:rollbackwith no flags against a project that already has a resolvedcs-launch.json.Rollback.init()builds the Apollo client viaprepareApiClients()beforerun()callsgetConfig(), so the client is constructed with nox-project-uid/organization_uidheaders.run()only rebuilds the client inside the!currentConfig?.uidbranch (interactive org/project selection) — which is skipped whenevergetConfig()already resolved auidfrom disk. Every subsequent query (including theEnvironmentsquery the rollback flow depends on) then goes out headerless, andEnvironmentsAuthGuardon the server can't find any project to match.getConfig()inrun(), so headers always reflect whatever project/org context was just resolved fromcs-launch.json(or flags), before any query fires.Root cause detail
-e/--environmentis passed (skipsgetConfig(), souidstays unset → falls into the org/project-selection branch, which happens to rebuild the client) or on a brand-new project beforecs-launch.jsonexists (same reason). Looked intermittent, but is fully deterministic on those two conditions.getConfig()resolvesuid, the rebuild branch is skipped, and the stale headerless client frominit()is used for the rest of the command.Change
src/commands/launch/rollback.ts— added one line inrun():