Skip to content

Conversation

@lialang-cisco
Copy link
Contributor

@lialang-cisco lialang-cisco commented Dec 18, 2024

COMPLETES CX-17334

This pull request addresses CX-17334

< DESCRIBE THE CONTEXT OF THE ISSUE >

by making the following changes we allow clients to know the difference between their system clock, and the time according to Mercury

< DESCRIBE YOUR CHANGES >

Each message and pong from mercury includes a fiend wsWriteTimestamp, the time (millis since epoch) at which the message was written to the websocket. The Webex App already uses this time to check whether the local system clock is correct (and compensate if it's not). This change exposes a value mercuryTimeOffset on mercury, which is the difference between this timestamp from mercury and Date.now(), updated each time we receive a message or pong; which will allow consumers of the SDK to do the same. This has already been successfully tested in the Webex contact center agent desktop client.

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

I certified that

  • I have read and followed contributing guidelines

  • I discussed changes with code owners prior to submitting this pull request

  • I have not skipped any automated checks

  • All existing and new tests passed

  • I have updated the documentation accordingly


Make sure to have followed the contributing guidelines before submitting.

Summary by CodeRabbit

  • New Features

    • Added time offset tracking mechanism for Mercury plugin
    • Enhanced synchronization capabilities by calculating time offsets during WebSocket communication
  • Tests

    • Added comprehensive test coverage for new time offset calculation method
    • Verified time offset tracking under various scenarios

@lialang-cisco lialang-cisco requested review from a team as code owners December 18, 2024 17:27
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2024

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

warning [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning eslint > @humanwhocodes/[email protected]: Use @eslint/config-array instead
warning eslint > @humanwhocodes/config-array > @humanwhocodes/[email protected]: Use @eslint/object-schema instead
warning eslint > file-entry-cache > flat-cache > [email protected]: Rimraf versions prior to v4 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > [email protected]: Glob versions prior to v9 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning eslint-import-resolver-typescript > [email protected]: Glob versions prior to v9 are no longer supported
warning [email protected]: Glob versions prior to v9 are no longer supported
warning intern > [email protected]: Glob versions prior to v9 are no longer supported
warning intern > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning jasmine > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > jest-config > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/reporters > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > jest-runtime > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/transform > babel-plugin-istanbul > test-exclude > [email protected]: Glob versions prior to v9 are no longer supported
warning mocha > [email protected]: Glob versions prior to v9 are no longer supported
warning mocha > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning [email protected]: 16.1.1
warning wd > [email protected]: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.

(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
warning wd > archiver > [email protected]: Glob versions prior to v9 are no longer supported
warning wd > [email protected]: request has been deprecated, see request/request#3142
warning wd > archiver > archiver-utils > [email protected]: Glob versions prior to v9 are no longer supported
warning wd > request > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning wd > request > [email protected]: this library is no longer supported
warning @babel/cli > [email protected]: Glob versions prior to v9 are no longer supported
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
warning @babel/[email protected]: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
warning @babel/polyfill > [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning @babel/runtime-corejs2 > [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning babel-plugin-lodash > [email protected]: Glob versions prior to v9 are no longer supported
warning workspace-aggregator-b7180648-be20-42a0-9c42-0846f571f9b9 > [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning workspace-aggregator-b7180648-be20-42a0-9c42-0846f571f9b9 > [email protected]: Glob versions prior to v9 are no longer supported
warning workspace-aggregator-b7180648-be20-42a0-9c42-0846f571f9b9 > [email protected]: 16.1.1
warning workspace-aggregator-b7180648-be20-42a0-9c42-0846f571f9b9 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
warning workspace-aggregator-b7180648-be20-42a0-9c42-0846f571f9b9 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
warning workspace-aggregator-b7180648-be20-42a0-9c42-0846f571f9b9 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
warning workspace-aggregator-b7180648-be20-42a0-9c42-0846f571f9b9 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
warning workspace-aggregator-b7180648-be20-42a0-9c42-0846f571f9b9 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
warning workspace-aggregator-b7180648-be20-42a0-9c42-0846f571f9b9 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
warning workspace-aggregator-b7180648-be20-42a0-9c42-0846f571f9b9 > @babel/[email protected]: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
error [email protected]: The engine "node" is incompatible with this module. Expected version "^14 || ^16 || ^17 || ^18 || ^19". Got "22.9.0"
error Found incompatible module.

Walkthrough

The pull request introduces a new mercuryTimeOffset property to the Mercury plugin, enhancing time tracking capabilities. The changes focus on calculating and setting a time offset based on WebSocket write timestamps. The _setTimeOffset method is added to compute the offset when receiving messages or pong events, with careful handling to ensure only valid timestamps are used. The accompanying test suite verifies the new functionality, ensuring robust implementation of the time offset tracking mechanism.

Changes

File Change Summary
packages/@webex/internal-plugin-mercury/src/mercury.js - Added mercuryTimeOffset property to session object
- Implemented _setTimeOffset method
- Updated _onmessage to call _setTimeOffset
- Added pong event listener in _attemptConnection
packages/@webex/internal-plugin-mercury/test/unit/spec/mercury.js - Added test suite for _setTimeOffset method
- Verified time offset calculation and handling

Sequence Diagram

sequenceDiagram
    participant Socket
    participant Mercury
    participant TimeOffset

    Socket->>Mercury: WebSocket Message
    Mercury->>TimeOffset: _setTimeOffset(event)
    alt Valid wsWriteTimestamp
        TimeOffset-->>Mercury: Calculate Time Offset
        Mercury->Mercury: Update mercuryTimeOffset
    else Invalid Timestamp
        Mercury->Mercury: Keep mercuryTimeOffset undefined
    end

    Socket->>Mercury: Pong Event
    Mercury->>TimeOffset: _setTimeOffset(event)
    alt Valid wsWriteTimestamp
        TimeOffset-->>Mercury: Calculate Time Offset
        Mercury->Mercury: Update mercuryTimeOffset
    end
Loading

Possibly related PRs

Suggested reviewers

  • marcin-bazyl
  • chburket
  • adhmenon
  • mkesavan13

Poem

🐰 Tick-tock goes the Mercury beat,
Timestamps dancing, oh so neat!
Offsets calculated with rabbit-like precision,
WebSocket messages find their true rendition
Time syncs smoothly, no delay in sight! 🕰️

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
packages/@webex/internal-plugin-mercury/src/mercury.js (1)

538-543: Consider adding time zone handling and documentation

While the implementation is correct, consider:

  1. Adding JSDoc to document the method's purpose and parameters
  2. Adding validation for extreme time differences that might indicate issues
  3. Considering time zone implications in the offset calculation
+/**
+ * Updates the Mercury time offset based on the websocket message timestamp
+ * @param {Object} event - The websocket event containing the write timestamp
+ * @private
+ */
 _setTimeOffset(event) {
   const {wsWriteTimestamp} = event;
-  if (typeof wsWriteTimestamp === 'number' && wsWriteTimestamp > 0) {
+  if (typeof wsWriteTimestamp === 'number' && wsWriteTimestamp > 0) {
+    const offset = Date.now() - wsWriteTimestamp;
+    // Validate that the offset is within reasonable bounds (e.g., ±24 hours)
+    if (Math.abs(offset) > 24 * 60 * 60 * 1000) {
+      this.logger.warn(`${this.namespace}: Unusually large time offset detected: ${offset}ms`);
+    }
+    this.mercuryTimeOffset = offset;
-    this.mercuryTimeOffset = Date.now() - wsWriteTimestamp;
   }
 }
packages/@webex/internal-plugin-mercury/test/unit/spec/socket.js (1)

Line range hint 753-803: Add test coverage for edge cases

While the basic functionality is well tested, consider adding test cases for:

  1. Invalid wsWriteTimestamp values (null, negative, non-numeric)
  2. Extreme time differences
  3. Time synchronization behavior over multiple pong messages

Example test cases to add:

it('handles invalid wsWriteTimestamp values', () => {
  const invalidTimestamps = [null, -1, 'invalid', undefined];
  invalidTimestamps.forEach(timestamp => {
    mockWebSocket.emit('message', {
      data: JSON.stringify({
        sequenceNumber: 3,
        id: 'mockid',
        wsWriteTimestamp: timestamp
      })
    });
    assert.isUndefined(socket.mercuryTimeOffset);
  });
});

it('updates time offset consistently across multiple pongs', () => {
  const timestamps = [1735689600000, 1735689601000, 1735689602000];
  const spy = sinon.spy();
  socket.on('pong', spy);
  
  timestamps.forEach(timestamp => {
    mockWebSocket.emit('message', {
      data: JSON.stringify({
        sequenceNumber: 3,
        id: 'mockid',
        type: 'pong',
        wsWriteTimestamp: timestamp
      })
    });
  });
  
  assert.equal(spy.callCount, timestamps.length);
  assert.isNumber(socket.mercuryTimeOffset);
});
packages/@webex/internal-plugin-mercury/test/unit/spec/mercury.js (1)

776-789: Add more test cases for comprehensive coverage.

While the current test case verifies basic functionality, consider adding these scenarios:

  • Test with different time offsets (positive and negative)
  • Test with missing or invalid wsWriteTimestamp
  • Test with edge cases (e.g., very large time differences)
 describe('#_setTimeOffset', () => {
   it('sets mercuryTimeOffset based on the difference between wsWriteTimestamp and now', () => {
     const event = {
       data: {
         wsWriteTimestamp: Date.now() - 1000,
       }          
     };
     assert.isUndefined(mercury.mercuryTimeOffset);
     mercury._setTimeOffset(event);
     assert.isDefined(mercury.mercuryTimeOffset);
     assert.true(mercury.mercuryTimeOffset > 0);
   });
+
+  it('handles missing wsWriteTimestamp gracefully', () => {
+    const event = { data: {} };
+    mercury._setTimeOffset(event);
+    assert.isUndefined(mercury.mercuryTimeOffset);
+  });
+
+  it('handles negative time offsets', () => {
+    const event = {
+      data: {
+        wsWriteTimestamp: Date.now() + 1000,
+      }
+    };
+    mercury._setTimeOffset(event);
+    assert.isDefined(mercury.mercuryTimeOffset);
+    assert.true(mercury.mercuryTimeOffset < 0);
+  });
 });
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 42bd008 and b7c2036.

📒 Files selected for processing (4)
  • packages/@webex/internal-plugin-mercury/src/mercury.js (4 hunks)
  • packages/@webex/internal-plugin-mercury/src/socket/socket-base.js (2 hunks)
  • packages/@webex/internal-plugin-mercury/test/unit/spec/mercury.js (1 hunks)
  • packages/@webex/internal-plugin-mercury/test/unit/spec/socket.js (2 hunks)
🔇 Additional comments (3)
packages/@webex/internal-plugin-mercury/src/socket/socket-base.js (1)

Line range hint 298-312: LGTM: Clean implementation of wsWriteTimestamp handling

The addition of wsWriteTimestamp parsing and inclusion in the processedEvent object is implemented correctly. The parseInt ensures proper type conversion for the timestamp.

packages/@webex/internal-plugin-mercury/src/mercury.js (2)

44-47: LGTM: Well-defined mercuryTimeOffset property

The property is correctly defined with appropriate type and default value, following the existing pattern in the session object.


204-204: LGTM: Proper event handler for time offset updates

The pong event handler is correctly added to update the time offset, ensuring synchronization on each pong message.

@aws-amplify-us-east-2
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-4035.d3m3l2kee0btzx.amplifyapp.com

@adhmenon adhmenon added the validated If the pull request is validated for automation. label Jan 10, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/@webex/internal-plugin-mercury/test/unit/spec/mercury.js (1)

776-809: LGTM! Comprehensive test coverage for time offset calculation.

The test suite thoroughly verifies the _setTimeOffset functionality with test cases for:

  1. Positive time offset calculation
  2. Negative time offset calculation
  3. Invalid timestamp handling

Consider adding a test case to verify that mercuryTimeOffset is updated correctly when multiple messages are received with different timestamps. This would ensure that the offset is consistently updated throughout the WebSocket connection lifecycle.

Example test case:

it('updates mercuryTimeOffset when multiple messages are received', () => {
  const firstEvent = {
    data: {
      wsWriteTimestamp: Date.now() - 60000,
    }          
  };
  const secondEvent = {
    data: {
      wsWriteTimestamp: Date.now() - 30000,
    }          
  };
  
  mercury._setTimeOffset(firstEvent);
  const firstOffset = mercury.mercuryTimeOffset;
  
  mercury._setTimeOffset(secondEvent);
  const secondOffset = mercury.mercuryTimeOffset;
  
  assert.notEqual(firstOffset, secondOffset);
  assert.isTrue(secondOffset < firstOffset);
});
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b7c2036 and 7f4f023.

📒 Files selected for processing (4)
  • packages/@webex/internal-plugin-mercury/src/mercury.js (4 hunks)
  • packages/@webex/internal-plugin-mercury/src/socket/socket-base.js (2 hunks)
  • packages/@webex/internal-plugin-mercury/test/unit/spec/mercury.js (1 hunks)
  • packages/@webex/internal-plugin-mercury/test/unit/spec/socket.js (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/@webex/internal-plugin-mercury/src/socket/socket-base.js
  • packages/@webex/internal-plugin-mercury/src/mercury.js
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Initialize Project
🔇 Additional comments (2)
packages/@webex/internal-plugin-mercury/test/unit/spec/socket.js (2)

753-761: LGTM! Test case correctly verifies wsWriteTimestamp handling.

The test case properly verifies that the wsWriteTimestamp is included in the emitted message data, which is essential for calculating the time offset between the client and Mercury service.


795-803: LGTM! Test case correctly verifies wsWriteTimestamp in acknowledged messages.

The test case properly verifies that the wsWriteTimestamp is included in the acknowledged message data, maintaining consistency with the message emission test.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/@webex/internal-plugin-mercury/src/mercury.js (1)

538-544: Add JSDoc documentation for the _setTimeOffset method.

While the implementation is correct, adding documentation would help explain the method's purpose and parameters.

+/**
+ * Sets the Mercury time offset based on the difference between the current time
+ * and the websocket write timestamp.
+ * @param {Object} event - The event object containing the websocket write timestamp
+ * @private
+ */
 _setTimeOffset(event) {
   const {wsWriteTimestamp} = event.data;
   if (typeof wsWriteTimestamp === 'number' && wsWriteTimestamp > 0) {
     this.mercuryTimeOffset = Date.now() - wsWriteTimestamp;
   }
 },
packages/@webex/internal-plugin-mercury/test/unit/spec/mercury.js (1)

776-809: Add test cases for boundary conditions.

The test coverage is good but could be enhanced with additional test cases:

 describe('#_setTimeOffset', () => {
   // ... existing tests ...
+  it('handles maximum safe integer timestamp', () => {
+    const event = {
+      data: {
+        wsWriteTimestamp: Number.MAX_SAFE_INTEGER
+      }
+    };
+    mercury._setTimeOffset(event);
+    assert.isDefined(mercury.mercuryTimeOffset);
+  });
+
+  it('handles zero timestamp', () => {
+    const event = {
+      data: {
+        wsWriteTimestamp: 0
+      }
+    };
+    mercury._setTimeOffset(event);
+    assert.isUndefined(mercury.mercuryTimeOffset);
+  });
 });
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f4f023 and 207030e.

📒 Files selected for processing (2)
  • packages/@webex/internal-plugin-mercury/src/mercury.js (4 hunks)
  • packages/@webex/internal-plugin-mercury/test/unit/spec/mercury.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Test - Unit
  • GitHub Check: Test - Syntax
  • GitHub Check: Test - Style
  • GitHub Check: Test - Integration
  • GitHub Check: Test - Browser
  • GitHub Check: AWS Amplify Console Web Preview
🔇 Additional comments (3)
packages/@webex/internal-plugin-mercury/src/mercury.js (3)

44-47: LGTM! Property declaration is well-defined.

The mercuryTimeOffset property is correctly declared with appropriate type and default value.


494-494: LGTM! Time offset is updated before message processing.

The placement of _setTimeOffset call is correct and maintains proper event handling order.


204-204: LGTM! Time offset is updated on pong events.

Adding the pong event listener helps maintain an accurate time offset through regular heartbeats.

@marcin-bazyl marcin-bazyl merged commit 07ac363 into webex:next Jan 31, 2025
13 checks passed
@lialang-cisco lialang-cisco deleted the mercuryTimeOffset branch September 25, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants