Skip to content

Conversation

@cristiand391
Copy link
Member

See this PR: jsforce/jsforce#1774
We do need the res[onse body for jsforce to tell when it shouldn't retry refreshing the session

What does this PR do?

in the linked jsforce PR we were able to stop the retry for sf data query because it doing a GET request straight from the start but during QA @soridalac noticed that sf org display was still getting stuck.

This is because org display tries to refresh the token here:
https://github.com/salesforcecli/plugin-org/blob/7b8d9631bd10f08c5bb2c720dfa915b6a080d6f2/src/commands/org/display.ts#L49

refreshAuth does a HEAD request (only HTTP headers returned), so jsforce wasn't able to tell it should stop retrying based on the body response.

updating the method to do a GET request now allows us to get the body msg:
Screenshot 2025-11-20 at 13 41 44

What issues does this PR fix or reference?

@W-19992404@

We do need the repsonse body for jsforce to tell when it shouldn't retry refreshing the session
@cristiand391 cristiand391 requested a review from a team as a code owner November 20, 2025 16:42
await this.getConnection().request(requestInfo);
public async refreshAuth(): Promise<ReturnType<Connection['refreshAuth']>> {
await this.getConnection().refreshAuth();
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was pretty much a dup of the Connection method so now we just call it

url = ensureString(ensureJsonMap(requestInfo).url);
return Promise.resolve({});
}
throw new Error('refreshAuth should always a GET request to get the response body');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UT now ensure we always do a GET request.

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.

4 participants