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

SDK's manager ready event callback might not be applied when a reload is triggered #866

Closed
trepmag opened this issue Nov 24, 2022 · 6 comments

Comments

@trepmag
Copy link
Collaborator

trepmag commented Nov 24, 2022

This happens when, for instance, mapx is pushing a new version and asking the user to reload. Then, it appears that on reload the initially ready callback isn't registered anymore or triggered on the reloaded instance?!...

@trepmag trepmag added the bug label Nov 24, 2022
@fxi
Copy link
Member

fxi commented Nov 24, 2022

Thanks
It's maybe related to the once handler used here, preventing to re-register the whole thing.
https://github.com/unep-grid/map-x-mgl/blob/staging/app/src/js/mx_helper_sdk.js#L10
If the window load event is not re-emitted after the reload...
Will check this.
If it's urgent, I can try to solve this before the next release.

@fxi
Copy link
Member

fxi commented Jan 17, 2023

As there is no reproducible example, I've made one :

https://jsfiddle.net/fxi/6Loabz8k/

But I was not able to reproduce the behaviour. The 'ready' event is always received, even after a reload.

Can you provide more info ?

@fxi
Copy link
Member

fxi commented Feb 22, 2023

@trepmag Could you provide more info ?

@trepmag
Copy link
Collaborator Author

trepmag commented Feb 22, 2023

Sorry not much since in practice reproducing the context isn't that much trivial (run a sdk app over a specific mapx version then rerun the same app over an update mapx version that requires a reload)...

@fxi
Copy link
Member

fxi commented Feb 22, 2023

ok.. I see. We should probably do something to reload the page that holds the SDK manager, e.g. a message "updated" ? This would also make sure that the sdk package would be the latest version, if fetched from "app.mapx.org/sdk" ... If using a CDN, this could lead to some versions mismatch, though..

@fxi
Copy link
Member

fxi commented Feb 22, 2023

I close this. After a dev session with @trepmag, I was able to test almost all cases of update in static/app mode and no issue observed.
However, if this issue is reproduced in a specific context, reopen it and add more information.
Thanks !

@fxi fxi closed this as completed Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants