Skip to content

fix: ConnectedOrgVersion returns 9.0.0.0 with token-provider auth, causing false solution version incompatibility#13

Closed
Copilot wants to merge 1 commit intomasterfrom
copilot/fix-package-import-issue
Closed

fix: ConnectedOrgVersion returns 9.0.0.0 with token-provider auth, causing false solution version incompatibility#13
Copilot wants to merge 1 commit intomasterfrom
copilot/fix-package-import-issue

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 23, 2026

With --environment (interactive auth), ServiceClient is constructed via the token-provider constructor which defers connection initialisation until the first Execute call. Package Deployer reads CrmSvc.ConnectedOrgVersion during solution validation before any Execute has run, sees the default 9.0.0.0, and rejects solutions requiring CDS ≥ 9.1.

Changes

  • CrmServiceClient.ConnectedOrgVersion (shim) — after the existing Execute(RetrieveVersion) warm-up attempt, re-read base.ConnectedOrgVersion. Calling Execute populates _connectionSvc.OrganizationVersion as a side-effect of connecting, so even when the RetrieveVersion response body can't be parsed the base property now reflects the real server version:

    // After try/catch for Execute(RetrieveVersion):
    var postWarmVersion = base.ConnectedOrgVersion;
    if (postWarmVersion > new Version(9, 0, 0, 0))
    {
        _cachedOrgVersion = postWarmVersion;
        return postWarmVersion;
    }
  • PackageDeployerRunner.Run() — move ConnectedOrgVersion logging outside the if (_request.Verbose) guard. This pre-warms the version cache before Package Deployer reads it, and surfaces the org version in normal output — useful when diagnosing version mismatch errors.

…s log org version

Agent-Logs-Url: https://github.com/TALXIS/tools-cli/sessions/ad0f3955-8b22-4197-8b08-a3c185c7072a

Co-authored-by: metjuperry <18303910+metjuperry@users.noreply.github.com>
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.

3 participants