You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Emitting a ClearData from inside of a plugin at query does not trigger the corresponding clearSeries(); in MctPlot.vue for all plot types.
Expected vs Current Behavior
Current behavior does not check all cases when an object requests a clear to a plot.
For reference, here is the logic:
compositionPathContainsId(domainObjectToFind) {
if (!domainObjectToFind.composition) {
return false;
}
return domainObjectToFind.composition.some((compositionIdentifier) => {
return this.openmct.objects.areIdsEqual(
compositionIdentifier,
this.domainObject.identifier
);
});
},
clearData(domainObjectToClear) {
// If we don't have an object to clear (global), or the IDs are equal, just clear the data.
// If we have an object to clear, but the IDs don't match, we need to check the composition
// of the object we've been asked to clear to see if it contains the id we're looking for.
// This happens with stacked plots for example.
// If we find the ID, clear the plot.
if (
!domainObjectToClear ||
this.openmct.objects.areIdsEqual(
domainObjectToClear.identifier,
this.domainObject.identifier
) ||
this.compositionPathContainsId(domainObjectToClear)
) {
this.clearSeries();
}
},
I believe that there's either a missing case not captured by compositionPathContainsId, or compositionPathContainsId is just plain bugged. I'd also assert that the if statement checking if the requesting object has a composition was added later to mask an error caused by this bug, rather than fixing the bug, because a base telemetry object won't have a composition so it won't error out but it will also not clear the data.
Here's the logic a little more readable:
if no domain object (clear data)
else if the object requesting the clear is the same as the currently plotting object (clear data)
else if the object requesting the clear's composition contains the currently plotting object (clear data)
This third case seems to be checking the opposite of what its function name implies which is this, the missing case:
else if the object requesting the clear is within the composition of the currently plotting object (clear data)
Steps to Reproduce
Add 'openmct.objectViews.emit('clearData',domainObject);'
to the TelemetryMeanProvider. On every query, the mean must be cleared and recalculated otherwise it won't be accurate due to the 1-N sample window receiving more telemetry than the initial query.
Create a new mean object and select it in the tree.
Observe that if the object is plotted directly, clear->query->plot action is performed as expected. That is the first case above.
Put the mean object into an overlay plot and zoom out. Observe that the plot is not cleared and requeried. That is case 4 above.
It is also exactly what case 3's function name describes:
compositionPathContainsId
The composition path (the overlay plot) contains the ID of the object requesting the clear. But it's not what the function does.
Environment
Open MCT Version:
Deployment Type:
OS:
Browser:
Impact Check List
Data loss or misrepresented data?
Regression? Did this used to work or has it always been broken?
Is there a workaround available?
Does this impact a critical component?
Is this just a visual bug with no functional impact?
Does this block the execution of e2e tests?
Does this have an impact on Performance?
Additional Information
The text was updated successfully, but these errors were encountered:
Poked at this some more and suggest updating the vue implementation to this:
compositionPathContainsId(domainObjectToFind) {
if (!domainObjectToFind.composition) {
return false;
}
return domainObjectToFind.composition.some((compositionIdentifier) => {
return this.openmct.objects.areIdsEqual(compositionIdentifier, this.domainObject.identifier);
});
},
plotCompositionContainsId(domainObjectToFind) {
if (!this.domainObject.composition) {
return false;
}
if (!domainObjectToFind.identifier){
return false;
}
return this.domainObject.composition.some((compositionIdentifier) => {
return this.openmct.objects.areIdsEqual(compositionIdentifier, domainObjectToFind.identifier);
});
},
clearData(domainObjectToClear) {
// If we don't have an object to clear (global), or the IDs are equal, just clear the data.
// If we have an object to clear, but the IDs don't match, we need to check the composition
// of the object we've been asked to clear to see if it contains the id we're looking for.
// This happens with stacked plots for example.
// If we find the ID, clear the plot.
if (!domainObjectToClear
|| this.openmct.objects.areIdsEqual(domainObjectToClear.identifier, this.domainObject.identifier)
|| this.compositionPathContainsId(domainObjectToClear)
|| this.plotCompositionContainsId(domainObjectToClear))
{
this.clearSeries();
}
},
Summary
Emitting a ClearData from inside of a plugin at query does not trigger the corresponding clearSeries(); in MctPlot.vue for all plot types.
Expected vs Current Behavior
Current behavior does not check all cases when an object requests a clear to a plot.
For reference, here is the logic:
I believe that there's either a missing case not captured by compositionPathContainsId, or compositionPathContainsId is just plain bugged. I'd also assert that the if statement checking if the requesting object has a composition was added later to mask an error caused by this bug, rather than fixing the bug, because a base telemetry object won't have a composition so it won't error out but it will also not clear the data.
Here's the logic a little more readable:
if no domain object (clear data)
else if the object requesting the clear is the same as the currently plotting object (clear data)
else if the object requesting the clear's composition contains the currently plotting object (clear data)
This third case seems to be checking the opposite of what its function name implies which is this, the missing case:
else if the object requesting the clear is within the composition of the currently plotting object (clear data)
Steps to Reproduce
to the TelemetryMeanProvider. On every query, the mean must be cleared and recalculated otherwise it won't be accurate due to the 1-N sample window receiving more telemetry than the initial query.
It is also exactly what case 3's function name describes:
compositionPathContainsId
The composition path (the overlay plot) contains the ID of the object requesting the clear. But it's not what the function does.
Environment
Impact Check List
Additional Information
The text was updated successfully, but these errors were encountered: