Skip to content

fix: WS URL creation for different instance URLs

Description

⚠️ Let's discuss first how we can make sure this change does not introduce any regression.


Fixes constructing URL for a WebSocket connection based on the base URL:

The new URL constructor acts somewhat unexpected and perhaps is causing an issue for the customers with the custom instance path.

Syntax for reference: new URL(url, base).

If the base doesn't end with a slash /, and url does start with a slash, it would result in an incorrect URL href.

For example:

new URL('/-/cable', 'https://instance.com/custom/path') => href: https://instance.com/-/cable.

You can run the tests form the first commint without the fix to see the issue.

Related Issues

Might fix https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/1804. You'll see that the customer instance URL has path included. What is a bit weird is that they say that Duo chat does work but not the Quick Chat though we use the same code to construct the WS href for both chats.

How has this been tested?

  • If src/browser or src/common has been modified, please consider interoperability with the Web IDE. See Running the Extension in WebIDE.
  • Consider an end-to-end test for significant new features that aren't covered by integration tests.

Screenshots (if appropriate)

What CHANGELOG entry will this MR create?

  • fix: Bug fix fixes - a user-facing issue in production - included in changelog
  • feature: New feature - a user-facing change which adds functionality - included in changelog
  • BREAKING CHANGE: (fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog
  • None - other non-user-facing changes
Edited by Olena Horal-Koretska

Merge request reports

Loading