Fix #12739: keep the restored current time on map load, snap only when no time is set - #12740
Merged
dsuren1 merged 1 commit intoJul 29, 2026
Conversation
…, snap only when no time is set
1 task
offtherailz
requested review from
allyoucanmap
and removed request for
allyoucanmap
July 27, 2026 14:28
dsuren1
approved these changes
Jul 29, 2026
Member
Author
|
Successfully created backport PR for |
Contributor
|
@ElenaGallo Kindly test it in DEV. Thanks! |
offtherailz
added a commit
that referenced
this pull request
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On map load the Timeline re-snaps the guide layer time and can overwrite a current time restored from the saved config. This change keeps the restored value and snaps only when there is no current time to preserve.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Issue
What is the current behavior?
#12739
When a map with a time layer is reloaded with a saved current time, the Timeline snaps that time to the nearest layer domain value on load. If the saved instant is not exactly a domain value, the current time (and the WMS
TIMEsent to the layer) changes to a different date. The result also depends on the timing of the asynchronous multidimensionaldescribeDomainsrequest, so it is not deterministic.Root cause: on
MAP_CONFIG_LOADED,epics/dimension.jsupdateLayerDimensionDataOnMapLoadrestores the current time and then asynchronously loads the domains. Meanwhileepics/timeline.jsselects the guide layer (updateTimelineDataOnMapLoad, oronUpdateLayerDimensionDatawhen none is selected). Selecting the guide layer snaps the time: bothinitializeSelectLayerandselectLayerdefault tosnap = true, sosnapTimeGuideLayerrunssetCurrentTime(nearestDomainValue)over the restored value.What is the new behavior?
The saved value wins when it exists; snapping happens only when there is no restored current time. On load the guide layer is still selected, but without snapping when a current time was restored from the config. User-driven layer selection keeps snapping as before.
Proposed fix, in
web/client/epics/timeline.js:updateTimelineDataOnMapLoad:initializeSelectLayer(selectedLayer, isEmpty(currentTime)).syncTimelineGuideLayer:selectLayer(firstTimeLayer, isEmpty(currentTimeSelector(state))).Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information
Regression tests added in
web/client/epics/__tests__/timeline-test.js:syncTimelineGuideLayerselects withsnap = truewhen no current time is set, and withsnap = falsewhen a current time is already set.updateTimelineDataOnMapLoadselects withsnap = falsewhen a current time is restored, and withsnap = true(plusAUTOSELECT) when none is.How to reproduce: load a saved map with a WMS time layer (WMTS multidimensional extension) whose stored
dimensionData.currentTimeis not one of the layer domain values and whosetimelineData.selectedLayerpoints to that layer. Before the fix the time snaps to a different value on load; after the fix the saved time is kept.