influxdata / influxdata/ui

EPIC: debugging the windowPeriod variable

Open
#4,837 3 comments 0 reactions 0 assignees View on GitHub
epic kind/bug team/automation team/ui
Dominant language
TypeScript
Stars
117
Forks
51
Avg merge
2d 15h
Merged PRs (30d)
4

Description

EAR: https://github.com/influxdata/EAR/issues/3421
tl;dr -- is a nesting doll of issues. Read details below.

Others are please welcomed to add to this list.

## Central questions being solved:
1. which inputs to consider when calculating the windowPeriod? Which ones override others?
* Input from timeRange picker:
* “Past 15m” etc have a preset timeRange.
* “Custom date” gets a calculated timeRange.
* Where in the flux query is windowPeriod used?
* On which range?
* Does this range use the timeRange from the outer UI? or it's own?
* Does the user declare `v = {windowPeriod: }` within the query itself?
Screen Shot 2022-06-28 at 11 49 07 PM
2. How does the data resolution for graphing, change the windowPeriod?
* `v.windowPeriod` gets modified for the data fetching. So we don't fetch more data than our pixels can render.
* Dumplings just put in a new graph-zoom-in feature. No idea how it's impacted this.

## Issues found:
* Incorrect calculation of the windowPeriod:
* This is an error for when reading the inner flux script.
* https://github.com/influxdata/ui/issues/4646
* scoping of the windowPeriod use and declaration.
* This is an error when combining the inner flux script, with the outer scope (windowPeriod from the UI).
* https://github.com/influxdata/ui/issues/4836
* conflict between internal and external declared variable `v`.
* This is our variable handling issue. It also impacts the `v.windowPeriod`.
* https://github.com/influxdata/ui/issues/4691
* re-calculation of `v.windowPeriod` based on data resolution limitations on the graph.
* Have to re-check the latest here, after merges for new graph-zoom-in features.
* It was a nested if/conditionals at multiple points throughout the calculation. Which could sometimes give unexpected results.
* declaration of windowPeriod variables (as state held in the UI, and then used for a query) had a cycle:
* This "bug" is about the src of truth.
* The redux state kept being the source of truth (in the codebase), for windowPeriod.
* But in actuality, it's the inner flux script + outer windowPeriod (UI variable).
* If I read the flux script --> then updated redux --> I was overwriting the UI inputs from that screenshot above.
* proposed solution:
* stop overloading `v.windowPeriod` .
* generate it only once, at runtime.
* all UI outer scope inputs are something else...which we then use within the calculation of windowPeriod.
* https://github.com/influxdata/ui/issues/4839

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.