leapconnect icon indicating copy to clipboard operation
leapconnect copied to clipboard

History: day navigation shows the wrong date / off-by-one (and off-by-two) until page refresh

Open markoceri opened this issue 5 months ago • 1 comments

Reported by @marmof in #16 (split out into a dedicated issue).

Problem

In the History section the date navigation is misaligned with the data being shown:

  1. On open, the current day is shown (e.g. 08/06).
  2. Stepping back one day does not show 07/06 data — it shows 05/06 data while the label reads 06/06.
  3. Stepping forward again to the current day shows 07/06 data while the label reads 08/06.
  4. Only after a page refresh does the correct value for today appear again.

So both the displayed date label and the loaded data set are off, and the state only recovers after a full reload.

Affected version

LeapConnect 0.8.2

Expected behavior

The date label and the loaded data must always stay in sync, and navigating back/forward must load the correct adjacent day without requiring a page refresh.

markoceri avatar Jun 15 '26 23:06 markoceri

Ok, this is the issue. The day-stepper built the request date with toISOString() (UTC) while the label used the local date, so at UTC+ offsets (Italy) it fetched the previous day. Refresh masked it because the default view uses a relative days=1 query.

Fixed: date ranges are now serialized from the local date, plus a guard so a slow response can't overwrite a newer navigation. Ships in the next release v0.11.0.

markoceri avatar Jun 16 '26 00:06 markoceri