@@ -32,18 +32,27 @@ class MCWSEVRStreamProvider extends MCWSStreamProvider {
3232 */
3333 getKey ( domainObject ) {
3434 // Can subscribe only by EVR module even if subscribing by EVR
35+ // This is the default cause for EVRs that contain a module.
3536 let module = domainObject . telemetry
3637 && domainObject . telemetry . definition
3738 && domainObject . telemetry . definition . module
38- && domainObject . telemetry . definition . module . toLowerCase ( ) ;
39+ && domainObject . telemetry . definition . module . toUpperCase ( ) ;
40+
41+ // This is the top-level vista.evrModule object, which contains
42+ // A module definition but not in the definition object.
43+ // This must be captured before an attempt at legacy EVRs is made
44+ // in case the module has underscores in it.
45+ if ( ! module || module . length <= 0 ) {
46+ module = domainObject . telemetry
47+ && domainObject . telemetry . module
48+ && domainObject . telemetry . module . toUpperCase ( ) ;
49+ }
3950
4051 // legacy inference of module by evr_name
41- // if this fallback is used will break on module names containing underscores
52+ // This should *never* occur with modern telemetry dictionaries.
4253 if ( ! module || module . length <= 0 ) {
4354 console . warn ( 'Legacy domain objects should not be used anymore!' ) ;
44- module = domainObject . telemetry . evr_name ?
45- domainObject . telemetry . evr_name . split ( "_" ) [ 0 ] . toLowerCase ( ) :
46- domainObject . telemetry . module . toLowerCase ( ) ;
55+ module = domainObject . telemetry . evr_name . split ( "_" ) [ 0 ] . toUpperCase ( )
4756 }
4857
4958 return module ;
0 commit comments