Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(meetings): incremental log uploads #3899

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

marcin-bazyl
Copy link
Collaborator

@marcin-bazyl marcin-bazyl commented Oct 9, 2024

This pull request addresses

Some existing issues with logging:

  1. We are often completely missing logs for successful meetings - this is probably because we upload them only on errors and on meeting leave and in successful cases users often just close the tab without clicking leave.
  2. For long running meetings, the sdk buffer gets full and we often have web app logs from the whole meeting but we are missing SDK logs from the beginning of the meeting.
  3. When errors happen and we leave the meeting as a result, we often end up uploading the same log multiple times - all these same copies are stored in the backend.

by making the following changes

Backend allows us to upload logs multiple times for same meeting, so instead of uploading the full log once, let's upload them periodically in smaller chunks - just the diff from the previous successful upload.

Added also config 2 options:

  1. to choose if we upload only diff or full logs - by default I kept full logs so it won't affect any existing SDK client apps
  2. a multiplication factor for upload intervals - so that the app can easily control how often logs are uploaded

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

manual run with the web app

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

Release Notes

  • New Features

    • Introduced new configuration options for log management, including incrementalLogs and logUploadIntervalMultiplicationFactor.
    • Added methods for managing periodic log uploads in the Meeting class, enhancing logging capabilities during meetings.
    • Added a public method to clear log buffers in the Logger class.
  • Bug Fixes

    • Implemented cleanup processes to stop periodic log uploads when a meeting ends.
  • Tests

    • Expanded test coverage for log upload functionality, ensuring logs are uploaded at specified intervals during meetings.

Copy link

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

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

Copy link

coderabbitai bot commented Dec 3, 2024

Walkthrough

This pull request introduces several changes across multiple files, primarily focused on enhancing logging functionalities and configurations within the Webex platform. Key additions include a new incrementalLogs property in the configuration, modifications to the submitLogs method to conditionally clear log buffers, and the introduction of methods for managing periodic log uploads in the Meeting class. Additionally, new testing cases are added to ensure the correct functionality of these logging features.

Changes

File Path Change Summary
packages/@webex/internal-plugin-support/src/config.js Added property incrementalLogs: false in the support object of the exported default configuration.
packages/@webex/internal-plugin-support/src/support.js Modified submitLogs method to clear logger buffers based on incrementalLogs configuration.
packages/@webex/plugin-logger/src/logger.js Added public method clearBuffers() to the Logger class for clearing log buffers.
packages/@webex/plugin-meetings/src/config.ts Added property logUploadIntervalMultiplicationFactor: 0 in the meetings object.
packages/@webex/plugin-meetings/src/meeting/index.ts Added methods startPeriodicLogUpload, stopPeriodicLogUpload, and setLogUploadTimer. Updated constructor to initialize logUploadIntervalIndex.
packages/@webex/plugin-meetings/src/meeting/util.ts Added method stopPeriodicLogUpload() in MeetingUtil for cleaning up periodic log uploads.
packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js Added test case for addMedia method to verify periodic log uploads.
packages/@webex/plugin-meetings/test/unit/spec/meeting/utils.js Added stub method stopPeriodicLogUpload in the test suite for MeetingUtil cleanup tests.

Possibly related PRs

  • fix: add ice candidates gathering timeout config #3951: The main PR introduces a new property incrementalLogs in the configuration, which is directly related to the changes in the submitLogs method in the Support class from the retrieved PR. The submitLogs method now checks for the incrementalLogs property to determine whether to clear logger buffers.
  • fix: added config for backend ipv6 native support #3962: This PR adds a new configuration option backendIpv6NativeSupport, which is also a configuration change similar to the addition of incrementalLogs in the main PR. Both changes expand the configuration structure in the config.js file.
  • fix(plugin-meetings): stop stats analyzer during reconnection #3990: The changes in this PR involve cleanup before reconnection, which relates to the logging and configuration management introduced in the main PR. Both PRs focus on improving the handling of configurations and their effects on operational behavior.
  • fix(plugin-meetings): added default bundlePolicy value #3996: This PR modifies the addMediaInternal method to set a default value for bundlePolicy, which is another example of enhancing configuration management similar to the addition of incrementalLogs in the main PR.

Suggested reviewers

  • chburket
  • robstax
  • szotrabh

🐰 In the meadow where logs do play,
New flags and methods brighten the day.
With buffers cleared and uploads in line,
Meetings will shine, oh so divine!
So hop along, let’s celebrate,
For logging’s new fate we can’t wait! 🎉

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-runtime > [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/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]: request has been deprecated, see request/request#3142
warning wd > archiver > [email protected]: Glob versions prior to v9 are no longer supported
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 > 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 > archiver > archiver-utils > [email protected]: Glob versions prior to v9 are no longer supported
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-53404b37-f4d4-410f-a6ae-5fc969ec633b > [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning workspace-aggregator-53404b37-f4d4-410f-a6ae-5fc969ec633b > [email protected]: Glob versions prior to v9 are no longer supported
warning workspace-aggregator-53404b37-f4d4-410f-a6ae-5fc969ec633b > [email protected]: 16.1.1
warning workspace-aggregator-53404b37-f4d4-410f-a6ae-5fc969ec633b > @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-53404b37-f4d4-410f-a6ae-5fc969ec633b > @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-53404b37-f4d4-410f-a6ae-5fc969ec633b > @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-53404b37-f4d4-410f-a6ae-5fc969ec633b > @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-53404b37-f4d4-410f-a6ae-5fc969ec633b > @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-53404b37-f4d4-410f-a6ae-5fc969ec633b > @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-53404b37-f4d4-410f-a6ae-5fc969ec633b > @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.


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 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.

@marcin-bazyl marcin-bazyl added the validated If the pull request is validated for automation. label Dec 3, 2024
@marcin-bazyl marcin-bazyl marked this pull request as ready for review December 3, 2024 13:04
@marcin-bazyl marcin-bazyl requested review from a team as code owners December 3, 2024 13:04
Copy link

@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: 2

🧹 Outside diff range and nitpick comments (6)
packages/@webex/plugin-meetings/src/meeting/index.ts (2)

706-706: Use consistent timer type declarations

The uploadLogsTimer property is declared with type ReturnType<typeof setTimeout>, whereas other timers in the class, such as keepAliveTimerId, are declared as NodeJS.Timeout. For consistency and to avoid potential type mismatches across environments, consider using NodeJS.Timeout for all timer properties.


4068-4126: Add documentation comments to new methods for clarity

To enhance code maintainability and readability, please add JSDoc comments to the newly introduced methods startPeriodicLogUpload, stopPeriodicLogUpload, and setLogUploadTimer. Documenting these methods will help other developers understand their purpose and usage.

packages/@webex/plugin-logger/src/logger.js (1)

255-268: Consider resetting groupLevel when clearing log buffers

When using clearBuffers() to reset the log buffers, consider also resetting the groupLevel property to 0. This prevents any unintended indentation in future logs due to residual group levels, ensuring consistent log formatting.

packages/@webex/plugin-meetings/test/unit/spec/meeting/utils.js (1)

Additional test coverage needed for periodic log upload feature

The implementation shows several untested aspects of the periodic log upload feature:

  • startPeriodicLogUpload() method with configuration via logUploadIntervalMultiplicationFactor
  • setLogUploadTimer() method's interval calculation and scheduling
  • Log upload behavior when media connection is lost
  • Automatic log upload triggers during reconnection scenarios

Suggested test cases to add:

  • Test initialization of periodic uploads with different interval configurations
  • Verify log upload stops when media connection is lost
  • Test the progressive interval increase through logUploadIntervalIndex
  • Verify automatic upload triggers during connection failures and reconnections
🔗 Analysis chain

Line range hint 42-68: Additional test coverage needed for new features.

While the cleanup scenario is well tested, consider adding test coverage for other aspects of the incremental log upload feature:

  1. Starting periodic log uploads
  2. Differential vs. full log upload behavior
  3. Upload interval configuration

Let me check the content of these files to see if they contain the test coverage we're looking for.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for existing test coverage of the new features

# Look for test files that might contain related tests
fd -e js -e ts . | rg -i "test|spec" | xargs rg -l "periodic.*log|incremental.*log|log.*upload"

Length of output: 226


Script:

#!/bin/bash
# Check content of the identified files
echo "=== Content of packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js ==="
rg -A 5 "periodic.*log|incremental.*log|log.*upload" "packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js"

echo -e "\n=== Content of packages/@webex/plugin-meetings/test/unit/spec/meetings/index.js ==="
rg -A 5 "periodic.*log|incremental.*log|log.*upload" "packages/@webex/plugin-meetings/test/unit/spec/meetings/index.js"

# Look for implementation of these features to understand what should be tested
echo -e "\n=== Looking for implementation of periodic/incremental log upload features ==="
rg -A 5 "startPeriodicLogUpload|stopPeriodicLogUpload|uploadLogs" "packages/@webex/plugin-meetings/src/"

Length of output: 13927

packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js (2)

Line range hint 4-4: Reminder: Address the TODO comment.

Please ensure that tests are added for this function to verify the behavior with the additional parameter.

Would you like me to help generate unit tests for this function?


Line range hint 12-24: Consider adjusting the fee structure or discount policy.

The current implementation has two issues:

  1. Indentation is inconsistent in the elif/else blocks. They should align with the if statement.

  2. The business logic may be problematic:

    • A flat $20 fee is added to any discounted total
    • For small purchases with 10% discount (3-4 years loyalty), the $20 fee can exceed the discount benefit
    • Example: $100 purchase with 10% discount = $90 + $20 = $110 (more than original price)

Would you like me to propose an alternative implementation that ensures discounts always benefit the customer?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 602e8c6 and bb2dd38.

📒 Files selected for processing (8)
  • packages/@webex/internal-plugin-support/src/config.js (1 hunks)
  • packages/@webex/internal-plugin-support/src/support.js (1 hunks)
  • packages/@webex/plugin-logger/src/logger.js (1 hunks)
  • packages/@webex/plugin-meetings/src/config.ts (1 hunks)
  • packages/@webex/plugin-meetings/src/meeting/index.ts (5 hunks)
  • packages/@webex/plugin-meetings/src/meeting/util.ts (1 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js (1 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/meeting/utils.js (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/@webex/plugin-meetings/src/meeting/util.ts
🔇 Additional comments (6)
packages/@webex/internal-plugin-support/src/config.js (1)

20-20: Addition of incrementalLogs property appears correct

The new incrementalLogs property is properly added to the support configuration object. This allows for control over incremental log submissions.

packages/@webex/plugin-meetings/src/config.ts (1)

99-99: Addition of logUploadIntervalMultiplicationFactor property appears correct

The new logUploadIntervalMultiplicationFactor property is appropriately added to control periodic log uploads. The accompanying comment clearly explains its usage, ensuring that if set to 0 or undefined, logs won't be uploaded periodically.

packages/@webex/internal-plugin-support/src/support.js (1)

110-113: Clearing log buffers after log submission

The conditional check for this.config.incrementalLogs and subsequent call to this.webex.logger.clearBuffers() correctly ensure that log buffers are cleared after logs are submitted when incremental logging is enabled. This prevents duplicate logs in future submissions.

packages/@webex/plugin-meetings/test/unit/spec/meeting/utils.js (2)

42-42: LGTM: Stub for new periodic log upload cleanup.

The addition of the stopPeriodicLogUpload stub aligns with the PR's objective to implement incremental log uploads, ensuring proper cleanup testing.


68-68: LGTM: Assertion verifies periodic log upload cleanup.

The assertion correctly verifies that stopPeriodicLogUpload is called once during meeting cleanup when LLM is enabled, which is essential for proper resource management.

packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js (1)

Line range hint 1-2: LGTM!

The subtraction function is implemented correctly.

Copy link

@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

🧹 Outside diff range and nitpick comments (3)
packages/@webex/plugin-meetings/src/meeting/index.ts (3)

4068-4084: Consider moving LOG_UPLOAD_INTERVALS to a constant.

The array of intervals could be moved to a class constant or external configuration to improve maintainability and reusability.

+ private static readonly LOG_UPLOAD_INTERVALS = [0.1, 1, 15, 15, 30, 30, 30, 60];

  private setLogUploadTimer() {
-   const LOG_UPLOAD_INTERVALS = [0.1, 1, 15, 15, 30, 30, 30, 60];
+   const intervals = Meeting.LOG_UPLOAD_INTERVALS;

4106-4113: Add null check for config property.

The config check could be more robust by explicitly checking if the multiplication factor is a positive number.

  public startPeriodicLogUpload() {
-   if (this.config.logUploadIntervalMultiplicationFactor && !this.uploadLogsTimer) {
+   if (typeof this.config.logUploadIntervalMultiplicationFactor === 'number' && 
+       this.config.logUploadIntervalMultiplicationFactor > 0 && 
+       !this.uploadLogsTimer) {

4120-4126: Consider adding cleanup in the destructor.

The stopPeriodicLogUpload method should be called when the meeting is destroyed to ensure proper cleanup.

Add a call to stopPeriodicLogUpload() in the class destructor or cleanup method:

  public clearMeetingData = () => {
+   this.stopPeriodicLogUpload();
    this.audio = null;
    this.video = null;
    // ... rest of the cleanup code
  };
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between bb2dd38 and e3fba89.

📒 Files selected for processing (4)
  • packages/@webex/plugin-meetings/src/meeting/index.ts (5 hunks)
  • packages/@webex/plugin-meetings/src/meeting/util.ts (1 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js (1 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/meeting/utils.js (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/@webex/plugin-meetings/src/meeting/util.ts
  • packages/@webex/plugin-meetings/test/unit/spec/meeting/utils.js
🧰 Additional context used
📓 Learnings (1)
packages/@webex/plugin-meetings/src/meeting/index.ts (1)
Learnt from: marcin-bazyl
PR: webex/webex-js-sdk#3899
File: packages/@webex/plugin-meetings/src/meeting/index.ts:4068-4126
Timestamp: 2024-12-03T13:21:58.600Z
Learning: In the `Meeting` class (`packages/@webex/plugin-meetings/src/meeting/index.ts`), the `stopPeriodicLogUpload()` method is called during meeting cleanup via `MeetingUtil.cleanUp()`, so it's already invoked when the meeting ends.
🔇 Additional comments (3)
packages/@webex/plugin-meetings/src/meeting/index.ts (2)

706-707: LGTM! Private properties added for managing periodic log uploads.

The new private properties are well-typed and appropriately scoped for managing the periodic log upload functionality.


7312-7312: LGTM! Appropriate placement of startPeriodicLogUpload call.

The periodic log upload is started after the media connection is successfully established, which is a good point to begin collecting logs.

packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js (1)

2468-2523: LGTM! Well-structured test for periodic log uploads

The test case thoroughly verifies the periodic log upload functionality:

  • Uses fake timers to control time progression
  • Verifies log upload triggers at expected intervals (100ms, 1s, 15s, 30s, 60s)
  • Checks that uploads stop when media connection is removed
  • Validates counter increments at the right times
  • Good use of helper function checkLogCounter to avoid code duplication

@marcin-bazyl marcin-bazyl merged commit 425cdb6 into webex:next Dec 4, 2024
13 checks passed
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.

3 participants