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

fix(plugin-meetings): do not wait for upload logs before destroying meeting #3957

Merged
merged 3 commits into from
Nov 7, 2024

Conversation

brycetham
Copy link
Contributor

@brycetham brycetham commented Nov 6, 2024

COMPLETES SPARK-574076

This pull request addresses

When leaving a meeting, if the logs fail to upload (for example, if the log upload service is down), the meeting may not be destroyed until much later (up to 23 seconds after leaving the meeting in my tests). If the user rejoins the meeting during that time, it may cause them to get removed from the meeting when the meeting is destroyed.

by making the following changes

Do not wait for the logs to be uploaded before destroying the meeting.

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

  1. Manually tested by hardcoding an invalid URL to mimic the log upload service not working. Confirmed that the issue no longer occurs in this scenario.
  2. Manually tested by artificially delaying the log upload until 15 seconds after the meeting ends. Logs still upload correctly, even if I rejoin within those 15 seconds.

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

Summary by CodeRabbit

  • New Features
    • Enhanced meeting log management with automatic log uploads before meeting destruction.
  • Bug Fixes
    • Improved control flow and clarity in meeting destruction logic.
  • Refactor
    • Cleaned up code for better readability and maintainability.

@brycetham brycetham requested review from a team as code owners November 6, 2024 20:49
Copy link

coderabbitai bot commented Nov 6, 2024

Walkthrough

The changes in this pull request involve modifications to the create method within the Meetings class, focusing on the process of meeting destruction and log management. An event listener for EVENTS.REQUEST_UPLOAD_LOGS has been added to trigger log uploads conditionally based on the autoUploadLogs configuration. The meeting instance is now destroyed only after logs are uploaded, and the inline destruction logic has been refactored for clarity. Additionally, a redundant comment was removed, and indentation was adjusted for better readability.

Changes

File Path Change Summary
packages/@webex/plugin-meetings/src/meetings/index.ts - Modified the create method to handle log uploads before meeting destruction.
- Added event listener for EVENTS.REQUEST_UPLOAD_LOGS.
- Refactored destruction logic for clarity.
- Removed redundant comment and adjusted indentation.

Possibly related PRs

Suggested reviewers

  • marcin-bazyl
  • edvujic
  • antsukanova

Poem

In the meadow where meetings convene,
Logs are uploaded, swift and keen.
With a hop and a skip, we ensure,
Destruction waits, the logs must secure.
Clarity shines in our code's embrace,
A dance of logic, a well-timed grace. 🐇✨


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.

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 (1)
packages/@webex/plugin-meetings/src/meetings/index.ts (1)

Line range hint 1252-1264: Consider extracting the log upload logic to reduce duplication.

The log upload logic is duplicated between the DESTROY_MEETING and REQUEST_UPLOAD_LOGS event handlers. Consider extracting it into a helper method:

+private uploadMeetingLogs(meetingInstance: Meeting) {
+  if (this.config.autoUploadLogs) {
+    this.uploadLogs({
+      callStart: meetingInstance?.locusInfo?.fullState?.lastActive,
+      locussessionid: meetingInstance?.locusInfo?.fullState?.sessionId,
+      correlationId: meetingInstance.correlationId,
+      feedbackId: meetingInstance.correlationId,
+      locusId: meetingInstance.locusId,
+      meetingId: meetingInstance.locusInfo?.info?.webExMeetingId,
+      autoupload: true,
+    });
+  }
+}

 createdMeeting.on(EVENTS.DESTROY_MEETING, (payload) => {
-  if (this.config.autoUploadLogs) {
-    this.uploadLogs({
-      callStart: createdMeeting.locusInfo?.fullState?.lastActive,
-      locussessionid: createdMeeting.locusInfo?.fullState?.sessionId,
-      correlationId: createdMeeting.correlationId,
-      feedbackId: createdMeeting.correlationId,
-      locusId: createdMeeting.locusId,
-      meetingId: createdMeeting.locusInfo?.info?.webExMeetingId,
-      autoupload: true,
-    });
-  }
+  this.uploadMeetingLogs(createdMeeting);
   this.destroy(createdMeeting, payload.reason);
 });

 createdMeeting.on(EVENTS.REQUEST_UPLOAD_LOGS, (meetingInstance) => {
-  if (this.config.autoUploadLogs) {
-    this.uploadLogs({
-      callStart: meetingInstance?.locusInfo?.fullState?.lastActive,
-      locussessionid: meetingInstance?.locusInfo?.fullState?.sessionId,
-      correlationId: meetingInstance.correlationId,
-      feedbackId: meetingInstance.correlationId,
-      locusId: meetingInstance.locusId,
-      meetingId: meetingInstance.locusInfo?.info?.webExMeetingId,
-      autoupload: true,
-    });
-  }
+  this.uploadMeetingLogs(meetingInstance);
 });
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between bde4df9 and 87cce01.

📒 Files selected for processing (1)
  • packages/@webex/plugin-meetings/src/meetings/index.ts (1 hunks)
🔇 Additional comments (1)
packages/@webex/plugin-meetings/src/meetings/index.ts (1)

1250-1250: LGTM! Log upload no longer blocks meeting destruction.

The changes correctly implement the PR objective by ensuring that log upload doesn't delay meeting destruction. This will prevent the reported 23-second delay when transitioning between meetings.

Also applies to: 1252-1252

Copy link

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

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

@brycetham brycetham added the validated If the pull request is validated for automation. label Nov 7, 2024
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