Conversation
|
| // A module definition but not in the definition object. | ||
| // This must be captured before an attempt at legacy EVRs is made | ||
| // in case the module has underscores in it. | ||
| if (!module || module.length <= 0) { |
There was a problem hiding this comment.
I think you can simplify (this was messy before you) the whole first part of this method with optional chaining:
let module = domainObject?.telemetry?.definition?.module?.toUpperCase();
// This is the top-level vista.evrModule object, which contains
// a module definition but not in the definition object.
// This must be captured before attempting legacy EVRs,
// in case the module contains underscores.
if (!module?.length) {
module = domainObject?.telemetry?.module?.toUpperCase();
}
davetsay
left a comment
There was a problem hiding this comment.
I think this needs comments or documentation or something. a link to mcws documentation would be nice, but not sure we can do that if mcws documentation is not yet open sourced.
I was looking through the docs to see if there was anything in particular I could pull, I wasn't finding anything. Is there anything in particular you'd like me to pull from there? I looked at the user guide and product guide |
The comment i'm referring to is why we are doing all this uppercase nonsense. It may not be in MCWS. It is just what AMPCS does. This comes from the discussion about formatting we had with @mudinthewater regarding what MCWS responses give us and what it expects for filters in requests, and why we ended up with uppercase, instead of lowercase. Unless we have the context of why we cannot change from uppercasing everything, we could very likely forget it and change this behavior in the future. |
add the comment to the relevant files |



Fixes: #392
Before:
domainObject.telemetry.definition.module first
domainObject.telemetry.evr_name.split("_")[0] if evr_name existed
domainObject.telemetry.module third
This caused it to break if modules had an underscore in them, and would also cause it to default to the legacy EVR name method before using the module definition from the dictionary.
Now:
domainObject.telemetry.definition.module first
domainObject.telemetry.module second
domainObject.telemetry.evr_name.split("_")[0] as a last ditch resort.
This should work for cases where the module has underscores now, as the module provided by the EVR dictionary will be used in all cases before trying to assume a module from the evr name.
There were instances where an EVR return would have an all caps module name, but OMM was forcing all lowercase module names in the evr stream. This caused a disconnect with the MCWS return so no EVRs would appear in module streams.
MCWS is case-agnostic for EVR streams, so best method here is to make stream requests internally consistent - other filters use all caps already (well, they use the dictionary default which is all caps), so we should also use it for both the request and the key.