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

Added polling when getting map layers from RPC #252

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

jlaamanen
Copy link
Contributor

MapLayerVisibilityRequests were sent via RPC too soon when displaying a page with map, because although Oskari responds that it's ready, the layers might not yet be assigned all the way to the internal map state. This is why these visibility requests might fail (race condition).

Replaced getAllLayers with a polling function that gets the layers from the map's internal state, to assure that the app may proceed in sending the visibility requests.

There might be better solutions to this in the future, when this issue gets done: oskariorg/oskari-documentation#58

Also (although probably not relevant to the fix) removed the excessive visibility requests when switching to a page without a map.

Copy link
Contributor

@ossitammi ossitammi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@jlaamanen jlaamanen merged commit 150309a into develop Dec 2, 2024
2 checks passed
@jlaamanen jlaamanen deleted the fix/too-early-rpc-requests branch December 2, 2024 12:42
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.

2 participants