Natixar / natixar-frontend

The static front end of the Natixar SaaS platform
0 stars 5 forks source link

TIme Step Changes never Cause a Back-end Request for Refreshed Data - Incorrect Display #37

Closed lepeuvedic-natixar closed 4 weeks ago

lepeuvedic-natixar commented 2 months ago

Problem: The front-end never requests data at any time scale other than months.

Steps to reproduce:

  1. Put proxy in debug mode to capture all the HTTP queries
  2. Click on "Quarter"
  3. Observe that the data is still requested from the back-end with "scale"="1m"
  4. Click on "Year", "Day" or "Hour"
  5. Observe the same request with "scale"="1m", instead of "1y", "1d" or "1h" respectively.

Desired behaviour: The front end shall assess which time scales are accessible (within 10000 steps limit) given the current date, and shall keep in memory the data it has got, that is related to all the accessible time scales. The front end shall NOT aggregate data time-wise itself. The front-end shall NOT break down data time-wise itself using possible aggregated data is received at a larger time scale The front end shall DISPLAY THE DATA IT RECEIVES AS IS, even if it receives data with a different time step. The front end shall explain in a hoover bubble why a short time scale is not accessible (would require more than 10000 steps given the dates) and why a long time scale is not accessible (zero aligned units of that time scale fall between the current "start and "end" dates.

astowny commented 1 month ago

What is send in the parameter scale if the quarter is selected ?

lnrreact commented 1 month ago

What is send in the parameter scale if the quarter is selected ?

It is hardcoded and always sent scale=1m due to this line

const scale: string = `1${TimeMeasurement.MINUTES}`

in src/components/network/NetworkIndicator.tsx

lepeuvedic commented 3 weeks ago

Workaround is unclear. Requesting always at day range and using the built-in aggregation functions might be a workaround (if they're correct). Leaving controls that apparently do nothing and wrong data on the charts is not a valid temporary fix.