jitsi-meet-react-sdk icon indicating copy to clipboard operation
jitsi-meet-react-sdk copied to clipboard

Script loading error persists on retry connection attempt

Open anejmarusic opened this issue 8 months ago • 0 comments

I have a React application that integrates your SDK. I'm encountering an issue when attempting a second connection after failing to connect to the Jitsi server initially (likely due to the server being inaccessible). To retry, I'm using a 'Try again' button to reload the JitsiMeeting component. However, on the second attempt, the GET request doesn't even proceed, and the Jitsi React SDK automatically returns the previous error response ('Script load error: https://my.domain.com/external_api.js').

Upon inspecting the source code, I identified that the issue lies within init.js:

let scriptPromise;

export const fetchExternalApi = (domain = DEFAULT_DOMAIN, release, appId) => {
    if (scriptPromise) {
        return scriptPromise;
    }

    scriptPromise = loadExternalApi(domain, release, appId);
    return scriptPromise;
};

It seems that the scriptPromise is saved and reused whenever fetchExternalApi is called again.

Could you please explain the reasoning behind this behavior and suggest a solution for my issue?

anejmarusic avatar Jun 28 '24 13:06 anejmarusic