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(ui-map): reload map data on study revisit #1927

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

hdinia
Copy link
Member

@hdinia hdinia commented Feb 8, 2024

Description:

We encounter a bug related to how study map data is fetched and displayed.
The current logic checks for the existence of map data based on the studyId or the absence of data in the state for the given study.
This approach works well when navigating within the same study; map data loads from the state, utilizing previously persisted Redux store data. However, an issue arises when a user exits a study, visits a different study, and then returns to the first study. Despite the expectation for the map to reload, it fails to do so.
This behavior is due to the isMapsExist condition evaluating to true the studyId exists in the store from the previous visit, preventing the map from reloading.

Cause:

The core of the issue lies in the reliance on the mere presence of study map data in the Redux store (isMapsExist) to determine whether to fetch map data. This condition fails to account for user navigations away from and back to a study within the same session, where a fresh fetch of map data may be necessary to ensure accurate and updated displays.

Fix:

To address this, we are introducing a more robust check that not only considers the existence of map data but also accounts for user navigations that necessitate refreshing map data.
This involves adjusting the logic to trigger a data fetch not just based on the absence of data but also under circumstances where a revisit to a study requires fresh data to ensure the map reflects the most current information.

@hdinia hdinia requested a review from skamril February 8, 2024 14:26
@hdinia hdinia self-assigned this Feb 8, 2024
@hdinia hdinia force-pushed the bugfix/map-nodes-display-issue branch 2 times, most recently from 5d7aab1 to 9dce579 Compare February 9, 2024 08:24
@hdinia hdinia force-pushed the bugfix/map-nodes-display-issue branch from 9dce579 to e22de44 Compare February 9, 2024 11:26
@hdinia hdinia merged commit 4e7fa44 into dev Feb 9, 2024
6 checks passed
@hdinia hdinia deleted the bugfix/map-nodes-display-issue branch February 9, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants