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

Inconsistent Timeline initialization #8534

Closed
1 task done
allyoucanmap opened this issue Sep 1, 2022 · 2 comments
Closed
1 task done

Inconsistent Timeline initialization #8534

allyoucanmap opened this issue Sep 1, 2022 · 2 comments

Comments

@allyoucanmap
Copy link
Contributor

allyoucanmap commented Sep 1, 2022

Description

Timeline is not initializing correctly because sometimes it is disabled probably due to a race condition where epics/reducers are loaded too late. We need to ensure that the reducers/epics of timeline are initialized correctly taking into account that Timeline is using also the dimension epics that rely on MAP_CONFIG_LOADED.

How to reproduce

  • open a map with timeline enabled (eg. #/viewer/openlayers/33077)
  • reload the page
  • temporary switch to another browser tab and go back to the mapstore viewer as soon the favicon stop the loading spinner (this is needed to slow the loading and make this bug more consistent)

Expected Result

  • the timeline is correctly initialized, this means that the inline date form is enabled, a layer selected and the cursor visible

image

Current Result

  • the inline date form is disabled, a layer is not selected and the cursor is not visible

image

  • Not browser related
Browser info (use this site: https://www.whatsmybrowser.org/ for non expert users)
Browser Affected Version
Internet Explorer
Edge
Chrome
Firefox
Safari

Other useful information

@alexander-fedorenko
Copy link
Contributor

This issue is a regression introduced by making timeline module plugin.
It's caused by the fact that timeline reducer added after MAP_CONFIG_LOADED action & epic that sets default layer for timeline.

There are two approaches to fix it:

  1. Apply changes that forces app to load map configuration only after plugins are loaded (changes are already there in another branch, nothing to code: 876d606 aaea42b 5a14c51 dec5003)
  2. Add reducer of timeline into app reducers.

While second one looks preferable, it won't protect us from other plugins misbehaving because of missed MAP_CONFIG_LOADED action. @allyoucanmap

@allyoucanmap
Copy link
Contributor Author

@alexander-fedorenko We could work with the first approach but we need to change some thing:

  • rename the callback onPluginsLoaded with onLoaded or other name because the onPluginsLoaded is already used by the PluginsContainer and it has a different role
  • remove the onPluginsLoadedHandler function it was needed only for the priority concept (the plugins.every check is not needed)

so please create a new commit with only needed changes, thanks

alexander-fedorenko added a commit to alexander-fedorenko/MapStore2 that referenced this issue Sep 2, 2022
@ElenaGallo ElenaGallo self-assigned this Sep 5, 2022
alexander-fedorenko added a commit to alexander-fedorenko/MapStore2 that referenced this issue Sep 5, 2022
alexander-fedorenko added a commit to alexander-fedorenko/MapStore2 that referenced this issue Sep 7, 2022
@offtherailz offtherailz added this to the v2022.02.00 milestone Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment