Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

If the connection is lost and the token is about to expire after reestablishing the connection agora doesn't fire connection-state-change event #130

Open
tsyrya opened this issue Mar 26, 2021 · 1 comment

Comments

@tsyrya
Copy link

tsyrya commented Mar 26, 2021

If the connection is lost and the token is about to expire after reestablishing the connection agora doesn't fire connection-state-change event. In the console I can see that the client is trying to join the channel, but can't because of the expired token. But I can't know about it because the event is not fired.

Log:

14:13:04:158 Agora-SDK [WARNING]: [client-42fb7] Choose server https://webrtc2-ap-web-1.agora.io/api/v1 failed, message: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: dynamic key expired, retry: false
websocket.onclose @ AgoraRTC_N-production.js?e671:661
AgoraRTC_N-production.js?e671:403 14:13:04:453 Agora-SDK [WARNING]: [client-42fb7] Choose server https://webrtc2-ap-web-3.agora.io/api/v1 failed, message: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: dynamic key expired, retry: false
AgoraRTC_N-production.js?e671:403 14:13:04:458 Agora-SDK [WARNING]: [client-42fb7] Choose server https://webrtc2-ap-web-4.agoraio.cn/api/v1 failed, message: AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: dynamic key expired, retry: false
AgoraRTC_N-production.js?e671:403 14:13:04:461 Agora-SDK [ERROR]: [gateway-client-42fb7] reconnect failed AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: dynamic key expired data: {"retry":false}

How can I handle that case and renew token when the connection is on?

Thanks

@tsyrya
Copy link
Author

tsyrya commented Mar 26, 2021

I tried to call renewToken any time the online event is fired. But seems like it doesn't affect the behaviour: the client keeps on trying to reconnect and logs the same error
reconnect failed AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: dynamic key expired data: {"retry":false}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant