Why does the Genesys Cloud TypeScript SDK fail silently when the access token expires in the middle of a Promise.all batch?
I’m running a script that fetches conversation details for a list of IDs. I’m using genesys-cloud (v3.0.1) with the @genesys-cloud/platform-client-sdk. The initial auth works fine, but about 200 requests in, the token expires. The SDK seems to trigger a refresh, but the original promises in the batch don’t retry. They just resolve with a 401 error object instead of throwing or retrying.
Here’s the setup:
import { PlatformClient } from '@genesys-cloud/platform-client-sdk';
const client = new PlatformClient();
await client.login();
const ids = getConversationIds(); // ~500 IDs
const promises = ids.map(id =>
client.conversationsApi.getConversation(id)
);
const results = await Promise.all(promises);
The error payload looks like this:
{
"error_code": "unauthorized",
"message": "The request requires user authentication."
}
I’ve checked the SDK source. It looks like the authMiddleware catches the 401 and calls refreshToken(), but it doesn’t seem to queue the failed request to retry after the new token is obtained. It just passes the error down the chain. Is this expected behavior for the v3 SDK, or am I missing a config flag to enable automatic retry on auth failure? I don’t want to wrap every call in a try/catch with manual retry logic if the SDK is supposed to handle this.