52North / helgoland-toolbox

Collection of tools for a sensor observation based client
https://52north.github.io/helgoland-toolbox/
Other
13 stars 16 forks source link

Unrecognized time parameter in permalink #166

Closed ridoo closed 1 year ago

ridoo commented 1 year ago

Sharing the current state per URL gives you a permalink containing timeseries ID and time interval of the displayed chart. Opening the permalink once looks good on a first glimpse. But, when changing the shown time interval by jumping back in history and re-open the permalink (which did not change in the address bar) the browser re-loads the site but the time parameter is not recognized anymore (i.e. the changed time interval stays the same).

I would expect the permalink parameter takes precedence over a cached (previously visited) time interval.

I tried with two instances of the Helgoland client:

EDIT:

The browser's localCache tricked my first observation that opening the permalink for the first time is ok. It turns out, opening the permalink in an incognito window will not set the timeseriesTime key in the browser's localCache at all. Once the time interval changes (by going backwards in history) it appears immediately. This, however, seems to work for the sensorweb.demo instance.

timeseries-service.service.ts does not look at the URL at all when creating a timestamp:

https://github.com/52North/helgoland-toolbox/blob/50f8504f608c8ee544d89d1e2718be961893da51/projects/helgoland-timeseries/src/app/services/timeseries-service.service.ts#L101-L103

I did not found the location where the parameters of a permalink are set, yet.

ridoo commented 1 year ago

Here's the part where the parameters should be parsed. However, it looks as if params[PARAM_IDS] is true-ish, it just returns and does not look at further parameters:

https://github.com/52North/helgoland-toolbox/blob/50f8504f608c8ee544d89d1e2718be961893da51/projects/helgoland-timeseries/src/app/views/diagram-view/diagram-view-permalink.service.ts#L36-L45