Closed joao-p-pinto-findmore closed 3 years ago
Turns out there was some sort of memory issue on the Vue side of things that was always using the previous token which is what was causing this issue. I'm closing this since there wasn't any real issue to start with.
Describe the bug
Hello, everyone.
I am using AgoraWebSDK-NG inside a Vue.js SPA to create a voice chat room. For each user I'm issuing 10 minute tokens (although I'm currently testing with 1 minute tokens because of the expiration events). When I get the
token-privilege-will-expire
event, which is triggered when only 30 seconds are left, I call my Web API, generate a new token and call therenew()
method on the FE with that token and everything works fine.However, I'm not able to restart/rejoin a channel after shutting it down (i.e. stopping and closing the audio track and leaving the client) if the original token used for that channel has expired. All subsequent tokens will not work and I will always get the following error:
AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: dynamic key expired data: {"retry":false}
.If I refresh the page I'm able to connect without any issue again.
I think it has to do with the renew method. Because if I leave and rejoin the call before the renew method is called, everything works fine, but after that I get the errors.
SDK Logs
I have enabled logs. This is an example of the errors I'm getting:
Channel: ea81473e-0cc7-429e-b6e7-d03226b76dc6
UID: 4bdb31fd-e4e1-4f79-a0ae-ebe3dd8aa6b7
Platform and Browser:
Windows 10 and Latest Chrome or Edge
SDK Version: "agora-rtc-sdk-ng": "4.3.0" on the FE "agora-access-token": "^2.0.4", on the BE
To Reproduce
Steps to reproduce the behavior:
Additional context
(All of this was tested on localhost, so everything is test data)
This is how I'm creating the client:
This is how I'm joining the channel:
I get this information after calling the BE endpoint that generates the token. The user ID is a GUID. An example configuration object is: