Skip to content

Conversation

@aleksandernsilva
Copy link
Contributor

@aleksandernsilva aleksandernsilva commented Mar 19, 2025

Proposed changes (including videos or screenshots)

This PR resolves an issue where Livechat would lose connection when registerGuest was called multiple times with the same token via the Livechat API.

The problem occurred because Livechat.unsubscribeAll was being called on every registerGuest call, regardless of whether the guest token had actually changed.

  • Moved unsubscribeAll to a more appropriate place within createOrUpdateGuest.
  • Added validation to ensure the guest token has changed before unsubscribing.

Issue(s)

CTZ-7

Steps to test or reproduce

  • Embed the livechat widget to a page
  • Via Livechat API call the method registerGuest providing a token, name and email
  • Start a conversation
  • Call registerGuest again with the same token
  • Try to send a message
  • Connection should have been severed

Further comments

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Mar 19, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Mar 19, 2025

🦋 Changeset detected

Latest commit: 4ac69ad

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/livechat Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Mar 19, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-35555/

Built to branch gh-pages at 2025-03-19 19:53 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@aleksandernsilva aleksandernsilva force-pushed the fix/register-guest-comms-issue branch from 5f0933b to 6983860 Compare March 19, 2025 16:28
@codecov
Copy link

codecov bot commented Mar 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.67%. Comparing base (825ece5) to head (4ac69ad).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #35555   +/-   ##
========================================
  Coverage    59.67%   59.67%           
========================================
  Files         2826     2826           
  Lines        68357    68357           
  Branches     15142    15142           
========================================
  Hits         40793    40793           
  Misses       24951    24951           
  Partials      2613     2613           
Flag Coverage Δ
unit 75.86% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@renatobecker renatobecker added this to the 7.5.0 milestone Mar 19, 2025
@aleksandernsilva aleksandernsilva marked this pull request as ready for review March 19, 2025 18:45
@aleksandernsilva aleksandernsilva requested review from a team as code owners March 19, 2025 18:45
@renatobecker renatobecker added the stat: QA assured Means it has been tested and approved by a company insider label Mar 19, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Mar 19, 2025
@aleksandernsilva aleksandernsilva force-pushed the fix/register-guest-comms-issue branch from b73df3a to 4ac69ad Compare March 19, 2025 19:04
@kodiakhq kodiakhq bot merged commit 041198c into develop Mar 19, 2025
48 checks passed
@kodiakhq kodiakhq bot deleted the fix/register-guest-comms-issue branch March 19, 2025 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants