timeseries: fix setting reset causing weird behavior #5458
Merged
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.
PR #5030 divided up the default setting from overrides and, in selector,
we have mixed two values in selectors to make a concrete settings value.
When reset, overriden values were set to
undefined
and caused thesettings to be very wrong.
Object spread (or
assign
) does not skip a property whose value isundefined
and causes settingOverride with undefined value to takeprecedence over the default value which, in the end, resolves the image
brightness/contrast values to
undefined
unlike what the typesindicated.
In the end, this is a fault of the type system since the interface is
defined as
Partial<>
and a value should really not haveundefined
value. To illustrate,
TypeScript 4.4 has a way to property guard against
undefined
value ina
Partial<>
type,"exactOptionalPropertyTypes"
but TensorBoard appcurrently violates the type definition so we will enable the tsconfig in
a subsequent changes.