Skip to content

Conversation

@KevLehman
Copy link
Member

@KevLehman KevLehman commented Jun 30, 2025

Proposed changes (including videos or screenshots)

Issue(s)

https://rocketchat.atlassian.net/browse/CTZ-272

Steps to test or reproduce

Basically, since we changed how settings are initialized on #34199, the file that "obtained" the server url to preppend to the livechat widget chunks was using the localhost url (default) instead of using the url the server was changed to.
This fix should allow it to be more reactive and change everytime the server url changes by just refreshing the widget on browser.

Further comments

Fixes #35485

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Jun 30, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Jun 30, 2025

🦋 Changeset detected

Latest commit: c436301

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

This PR includes changesets to release 36 packages
Name Type
@rocket.chat/meteor 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/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client 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/mock-providers Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip 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 Jun 30, 2025

PR Preview Action v1.6.2

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

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

@codecov
Copy link

codecov bot commented Jun 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.91%. Comparing base (8290892) to head (c436301).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #36332      +/-   ##
===========================================
- Coverage    64.91%   64.91%   -0.01%     
===========================================
  Files         3156     3157       +1     
  Lines       104944   104947       +3     
  Branches     19947    19947              
===========================================
- Hits         68129    68126       -3     
- Misses       34132    34135       +3     
- Partials      2683     2686       +3     
Flag Coverage Δ
e2e 57.69% <ø> (+<0.01%) ⬆️
unit 69.72% <ø> (-0.01%) ⬇️

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.

@KevLehman KevLehman marked this pull request as ready for review June 30, 2025 19:41
@KevLehman KevLehman requested a review from a team as a code owner June 30, 2025 19:41
@KevLehman KevLehman added the stat: QA assured Means it has been tested and approved by a company insider label Jun 30, 2025
@scuciatto scuciatto added this to the 7.9.0 milestone Jul 1, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jul 1, 2025
@scuciatto scuciatto removed this from the 7.9.0 milestone Jul 1, 2025
@dionisio-bot dionisio-bot bot removed the stat: ready to merge PR tested and approved waiting for merge label Jul 1, 2025
@scuciatto
Copy link
Member

Can we have a test for this?

@KevLehman
Copy link
Member Author

It would be nice, but actually apart from some units i dont see much value 🤔 and even units, i dont see much value either cause the function is just 2 lines...

but if u want, i can try to add some.

@scuciatto
Copy link
Member

It would be nice, but actually apart from some units i dont see much value 🤔 and even units, i dont see much value either cause the function is just 2 lines...

but if u want, i can try to add some.

It’s not something I want to insist on, but since this is a fix, we should include a test to ensure it doesn’t break again in the future.

@KevLehman KevLehman requested a review from a team as a code owner July 4, 2025 19:32
Copy link
Contributor

@pierre-lehnen-rc pierre-lehnen-rc left a comment

Choose a reason for hiding this comment

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

Note: the unit tests on this PR simply check if the function that replaces URLs is replacing with the right value, assuming a valid input.

It doesn't check if the actual file gets replaced properly - but if that were to fail, then the existing tests would catch the problem already.

The existing tests didn't catch this bug because all of our CI and development environments run in the localhost URL which is used by default before the settings are loaded. Maybe we should have at least some testing environments run on a custom URL...

@KevLehman KevLehman added the stat: ready to merge PR tested and approved waiting for merge label Jul 7, 2025
@kodiakhq kodiakhq bot merged commit 0d2df48 into develop Jul 7, 2025
49 checks passed
@kodiakhq kodiakhq bot deleted the fix/livechat-wrong-server-url branch July 7, 2025 17:47
@scuciatto scuciatto added this to the 7.9.0 milestone Jul 18, 2025
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.

Livechat Widget tries to connect to localhost

6 participants