voxeraShouldRefreshCredentials function
When to fetch a fresh token while the SDK is still retrying a dropped session on its own.
The SDK retries a dropped session ten times (about 50 seconds) with the URL and token it joined with. When the media node restarted with a new key, or the engine moved the room to another node, every one of those attempts is refused, and only then does the kit's own rejoin mint a new token. Asking the engine early and handing the SDK the fresh URL and token lets the remaining attempts land, without leaving the room.
Attempt 1 is an immediate resume and attempt 2 follows 300ms later; a short blip is usually over by then and needs nothing. From attempt 3 on, a fresh token is fetched once, and once more at attempt 6 in case the first fetch failed or the room moved again.
Implementation
bool voxeraShouldRefreshCredentials(int attempt) => attempt == 3 || attempt == 6;