Skip to content

392 force uppercase module subscriptions#412

Open
jvigliotta wants to merge 4 commits intomainfrom
evr-module-definition
Open

392 force uppercase module subscriptions#412
jvigliotta wants to merge 4 commits intomainfrom
evr-module-definition

Conversation

@jvigliotta
Copy link
Copy Markdown
Collaborator

Fixes: #392

  1. Corrects order of operations in assigning a module to an EVR stream request.

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.

  1. Makes module stream requests all caps and all internally consistent.
    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.

@jvigliotta jvigliotta added this to the MC 2608 - Open MCT Release milestone Mar 9, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 9, 2026

Comment thread src/realtime/MCWSEVRStreamProvider.js Outdated
// 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) {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
}

Comment thread src/realtime/MCWSEVRStreamProvider.js
Copy link
Copy Markdown
Collaborator

@davetsay davetsay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jvigliotta
Copy link
Copy Markdown
Collaborator Author

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

@davetsay
Copy link
Copy Markdown
Collaborator

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.

@davetsay
Copy link
Copy Markdown
Collaborator

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

@davetsay davetsay self-requested a review April 17, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EVR streams by module can have mismatched case on the module subscription

2 participants