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

Fix: Reattempt to initialise rg4js if a key is after a load has completed. #474

Closed
wants to merge 1 commit into from

Conversation

Codex-
Copy link
Contributor

@Codex- Codex- commented Jul 25, 2022

PR to resolve #454

Reproduction of the issue: https://github.com/Codex-/rg4js-init-issue

Details of the issue: https://github.com/Codex-/rg4js-init-issue/tree/patch_test#rg4js-initialisation-issue-reproduction

I have tested this via a patch with logging on a branch which can be found here: https://github.com/Codex-/rg4js-init-issue/tree/patch_test

Logging output without fix:

raygun umd loaded
App raygun key has been set
App manual config slow started
raygun4js addEventListener load complete
raygun4js onLoadHandler <--------------------- init would happen here if the key was configured.
App manual config finished
App raygun key has been set
App raygun config run

Logging output with fix:

raygun umd loaded
App raygun key has been set
App manual config slow started
raygun4js addEventListener load complete
raygun4js onLoadHandler
raygun4js onLoadHandler hasCalledOnLoad true
App manual config finished
raygun4js hasCalledOnLoad true, calling onLoadHandler again...
raygun4js onLoadHandler <--------------------- init has happened now with a key set, huzzah!
raygun4js onLoadHandler hasCalledOnLoad true
App raygun key has been set
App raygun config run

Please let me know if you need any more details :)

@Deacon-McIntyre
Copy link
Contributor

Thanks @Codex- - we're just testing this out on our end, looks good so far

@Codex- Codex- closed this Aug 22, 2022
@Codex- Codex- deleted the bugfix/api_key_after_load branch June 13, 2023 05:02
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

Successfully merging this pull request may close these issues.

raygun4js only initialises if apiKey is set when onLoadHandler is called
2 participants