fix: Sync load scripts in webviews to fix CORS
- fix: Sync load scripts in webviews to fix CORS (!1403 - merged)
- Web IDE
vscode-extension
update MR: fix: Duo Chat CORS (gitlab-web-ide!286 - closed)
Description
This MR fixes Duo Chat for Self-Managed by removing the need for CORS loading the script. This was an issue because of type="module"
that is automatically added by Vite.
Vite makes a huge assumption that moving all scripts to the head
and adding type="module"
is safe.
In reality this transforms the request from a no-cors
to a cors
which is big issue in these VSCode webviews since they have to run in a separate origin.
Related Issues
How has this been tested?
- Using
Run Extension
in VSCode project - In the Web IDE by creating an MR updating
gitlab-vscode-extension
to this MR branch and runningcreate-development-package
then updating the main GitLab 'package.json` to point to that development package
Screenshots (if appropriate)
On Desktop:
On Web IDE in GDK:
Patch to enable duo_chat
diff --git a/ee/app/graphql/resolvers/ai/user_chat_access_resolver.rb b/ee/app/graphql/resolvers/ai/user_chat_access_resolver.rb
index 4f655e182636..76f5286e1fd1 100644
--- a/ee/app/graphql/resolvers/ai/user_chat_access_resolver.rb
+++ b/ee/app/graphql/resolvers/ai/user_chat_access_resolver.rb
@@ -6,6 +6,7 @@ class UserChatAccessResolver < BaseResolver
type ::GraphQL::Types::Boolean, null: false
def resolve
+ return true
return false unless current_user
Feature.enabled?(:ai_duo_chat_switch, type: :ops) &&
Types of changes
-
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 -
Chore (Related to CI or Packaging to platforms) -
Test gap
Edited by Paul Slaughter