Hitting 429 Too Many Requests when pushing bulk user updates via the JS SDK. The rate limit headers are clear, but the SDK doesn’t seem to auto-retry or respect the Retry-After value in the response body. Here’s the loop causing the issue:
const updateUsers = async (users) => {
for (const user of users) {
try {
await platformClient.users.updateUser(user.id, user);
} catch (error) {
if (error.status === 429) {
console.warn('Rate limited. Stopping.');
// Manual sleep is a hack, but necessary?
await new Promise(r => setTimeout(r, 5000));
} else {
throw error;
}
}
}
};
Is there a built-in mechanism in genesyscloud to handle this, or do I need to implement exponential backoff manually? The Retry-After header is present, but parsing it from the error object feels tedious.