Skip to content

fix(salesforce-data-cloud): don't label getAllMetadata failures as token-exchange errors (YET-1631)#341

Open
benitezfede wants to merge 1 commit into
mainfrom
fbenitez/yet-1631-fix-token-exchange-msg
Open

fix(salesforce-data-cloud): don't label getAllMetadata failures as token-exchange errors (YET-1631)#341
benitezfede wants to merge 1 commit into
mainfrom
fbenitez/yet-1631-fix-token-exchange-msg

Conversation

@benitezfede

Copy link
Copy Markdown
Contributor

What's new?

  • SalesforceDataCloudProxyClient.list_tables wrapped both the a360 token exchange and the subsequent getAllMetadata query in one except SalesforceCDPError, labeling every failure Token exchange failed for dataspace '…' … verify the dataspace name and that the connected app's Run-As user has permission. That mis-attributes a post-exchange metadata-query failure (the token was obtained, then e.g. a transient DEADLINE_EXCEEDED) as a token/permission problem — sending triage to check permissions/dataspace config when the real cause is a transient Salesforce timeout.
  • Now distinguishes the two: a metadata-query failure (getAllMetadata / "executing metadata query" in the error) raises Metadata query failed for dataspace '…': … (no permission hint); a genuine token-exchange failure keeps the original message. The KeyError (missing access_token) branch is a real token-exchange failure and is unchanged.

Related issues and PRs

  • YET-1631
  • Sibling: YET-1630 / data-collector #2461 — adds a retry for these transient metadata-query failures. This PR only fixes the misleading label so on-call/logs see the real cause.

Testing

  • New unit test test_list_tables_metadata_query_failure_not_labeled_token_exchange: a getAllMetadata SalesforceCDPError (DEADLINE_EXCEEDED) now surfaces as "Metadata query failed", not "Token exchange failed" / "verify the dataspace name".
  • Full apollo SFDC suite: 30 passed (existing token-exchange / invalid-dataspace tests unchanged).

🤖 Generated with Claude Code

…ken-exchange errors (YET-1631)

list_tables wraps both the a360 token exchange and the subsequent getAllMetadata query in one except SalesforceCDPError, labeling all of them 'Token exchange failed for dataspace ... verify the dataspace name and Run-As permission'. That mis-attributes a post-exchange metadata-query failure (token obtained, then e.g. a transient DEADLINE_EXCEEDED) as a token/permission problem, sending triage down the wrong path.

Distinguish the two: a metadata-query failure (getAllMetadata / 'executing metadata query' in the message) now raises 'Metadata query failed for dataspace ...' (no permission hint); otherwise keep the token-exchange/permission message. The KeyError (missing access_token) branch is a genuine token-exchange failure and is unchanged. Sibling of data-collector YET-1630.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@benitezfede benitezfede requested a review from a team as a code owner June 26, 2026 03:08
@linear

linear Bot commented Jun 26, 2026

Copy link
Copy Markdown

YET-1631

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.

1 participant