Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script loading error persists on retry connection attempt #45

Open
anejmarusic opened this issue Jun 28, 2024 · 0 comments
Open

Script loading error persists on retry connection attempt #45

anejmarusic opened this issue Jun 28, 2024 · 0 comments

Comments

@anejmarusic
Copy link

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?

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

No branches or pull requests

1 participant