Telemetry request interceptors ignore configured priority
Summary
TelemetryRequestInterceptorRegistry documents support for a priority value on telemetry request interceptors, where a higher priority should have more weight than a lower one.
However, getInterceptors() currently returns applicable interceptors in registration order and does not sort them by priority.
As a result, the execution order of telemetry request interceptors is determined by plugin registration order rather than the configured interceptor priority.
Expected vs Current Behavior
Expected: Applicable telemetry request interceptors should be returned in descending priority order, consistent with other priority-based registries in Open MCT. Interceptors without an explicit priority should use the default priority.
Current: Applicable telemetry request interceptors are returned in registration order regardless of their configured priority.
Steps to Reproduce
- Create three telemetry request interceptors with priorities
-1000, no explicit priority, and1000. - Register them in the following order:
-1000, default,1000. - Call
TelemetryRequestInterceptorRegistry.getInterceptors(). - Observe that the returned order matches registration order (
-1000, default,1000) instead of descending priority order (1000, default,-1000).
Environment
- Open MCT Version:
4.3.1 - Deployment Type: local development
- OS: Windows 10
- Browser: Brave / Chromium 152
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
TelemetryRequestInterceptor.js already contains a TODO indicating that interceptors should be sorted by priority.
The existing object InterceptorRegistry implements analogous behavior by:
- treating an unspecified interceptor priority as
0 - sorting higher numeric priorities before lower priorities
A regression unit test can reproduce the issue and verify the expected ordering behavior.
Source: nasa/openmct