From ce59c0f50a85790ad6203eff257a6cf05699fbbe Mon Sep 17 00:00:00 2001 From: Shefali Joshi Date: Tue, 3 Oct 2023 13:41:02 -0700 Subject: [PATCH] Check realtime mode in remote clock interceptor (#6985) * Revert Date.now() purge change Check that the request is using realtime before using the remote-clock start and end timestamps for telemetry requests * docs: clarify comment --------- Co-authored-by: Jesse Mazzella --- src/plugins/remoteClock/requestInterceptor.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/remoteClock/requestInterceptor.js b/src/plugins/remoteClock/requestInterceptor.js index a963249e8b..e55137160c 100644 --- a/src/plugins/remoteClock/requestInterceptor.js +++ b/src/plugins/remoteClock/requestInterceptor.js @@ -31,10 +31,16 @@ function remoteClockRequestInterceptor(openmct, _remoteClockIdentifier, waitForB return activeClock?.key === 'remote-clock' && !remoteClockLoaded; }, invoke: async (request) => { - const { start, end } = await waitForBounds(); - remoteClockLoaded = true; - request.start = start; - request.end = end; + const timeContext = request?.timeContext ?? openmct.time; + + // Wait for initial bounds if the request is for real-time data. + // Otherwise, use the bounds provided by the request. + if (timeContext.isRealTime()) { + const { start, end } = await waitForBounds(); + remoteClockLoaded = true; + request.start = start; + request.end = end; + } return request; }