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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: extension gets activated in both web worker extension host and remote extension host #183901

Closed
jeanp413 opened this issue May 31, 2023 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release regression Something that used to work is now broken verified Verification succeeded
Milestone

Comments

@jeanp413
Copy link
Contributor

  • VS Code Version: from sources

Steps to Reproduce:

  1. Inline a web extension in builtinExtensionsScannerService.ts that can run in web and remote, e.g. git-base
  2. Run vscode from sources
  3. 馃悰 extension gets activated in both extension host, check extension host logs

Code pointer

if (isInitialStart) {
// Here we load even extensions that would be disabled by workspace trust
const localExtensions = checkEnabledAndProposedAPI(this._extensionEnablementService, this._extensionsProposedApi, await this._scanWebExtensions(), /* ignore workspace trust */true);
const runningLocation = runningLocations.computeRunningLocation(localExtensions, [], false);
const myExtensions = filterExtensionDescriptions(localExtensions, runningLocation, extRunningLocation => desiredRunningLocation.equals(extRunningLocation));
return {
allExtensions: localExtensions,
myExtensions: myExtensions.map(extension => extension.identifier)
};

cc @alexdima

@jeanp413 jeanp413 changed the title Extension gets activated in both web worker extension host and remote extension host Regression: extension gets activated in both web worker extension host and remote extension host May 31, 2023
@bpasero bpasero assigned sandy081 and unassigned bpasero May 31, 2023
@sandy081 sandy081 assigned alexdima and unassigned sandy081 May 31, 2023
@connor4312 connor4312 self-assigned this May 31, 2023
@connor4312
Copy link
Member

Potentially related: #183921

@jeanp413
Copy link
Contributor Author

jeanp413 commented Jun 1, 2023

@connor4312 The linked issue is not related as it's reported using stable version.

This regression is from the work on the remote resolvers api in this iteration #180263, so it would be good to fix it before releasing version 1.79

@alexdima alexdima added this to the May 2023 milestone Jun 1, 2023
@alexdima alexdima added candidate Issue identified as probable candidate for fixing in the next release regression Something that used to work is now broken labels Jun 1, 2023
@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Jun 1, 2023
@sandy081 sandy081 reopened this Jun 2, 2023
@VSCodeTriageBot VSCodeTriageBot removed the unreleased Patch has not yet been released in VS Code Insiders label Jun 2, 2023
@sandy081
Copy link
Member

sandy081 commented Jun 2, 2023

Reopening this because it is not merged into release branch yet.

@sandy081 sandy081 added the bug Issue identified by VS Code Team member as probable bug label Jun 2, 2023
@alexdima
Copy link
Member

alexdima commented Jun 2, 2023

To verify, please check out the release branch and run from sources with the following patch:

patch
diff --git a/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts b/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts
index 27f37ac508b..8ef9dcbf68e 100644
--- a/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts
+++ b/src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts
@@ -84,7 +84,130 @@ export class BuiltinExtensionsScannerService implements IBuiltinExtensionsScanne
 	}
 
 	async scanBuiltinExtensions(): Promise<IExtension[]> {
-		return [...await Promise.all(this.builtinExtensionsPromises)];
+		const r = [...await Promise.all(this.builtinExtensionsPromises)];
+		const manifest: any = {
+			'name': 'git-base',
+			'displayName': '%displayName%',
+			'description': '%description%',
+			'version': '1.0.0',
+			'publisher': 'vscode',
+			'license': 'MIT',
+			'engines': {
+				'vscode': '0.10.x'
+			},
+			'categories': [
+				'Other'
+			],
+			'activationEvents': [
+				'*'
+			],
+			'main': './out/extension.js',
+			'browser': './dist/browser/extension.js',
+			'icon': 'resources/icons/git.png',
+			'scripts': {
+				'compile': 'gulp compile-extension:git-base',
+				'watch': 'gulp watch-extension:git-base',
+				'update-grammar': 'node ./build/update-grammars.js'
+			},
+			'capabilities': {
+				'virtualWorkspaces': true,
+				'untrustedWorkspaces': {
+					'supported': true
+				}
+			},
+			'contributes': {
+				'commands': [
+					{
+						'command': 'git-base.api.getRemoteSources',
+						'title': '%command.api.getRemoteSources%',
+						'category': 'Git Base API'
+					}
+				],
+				'menus': {
+					'commandPalette': [
+						{
+							'command': 'git-base.api.getRemoteSources',
+							'when': 'false'
+						}
+					]
+				},
+				'languages': [
+					{
+						'id': 'git-commit',
+						'aliases': [
+							'Git Commit Message',
+							'git-commit'
+						],
+						'filenames': [
+							'COMMIT_EDITMSG',
+							'MERGE_MSG'
+						],
+						'configuration': './languages/git-commit.language-configuration.json'
+					},
+					{
+						'id': 'git-rebase',
+						'aliases': [
+							'Git Rebase Message',
+							'git-rebase'
+						],
+						'filenames': [
+							'git-rebase-todo'
+						],
+						'filenamePatterns': [
+							'**/rebase-merge/done'
+						],
+						'configuration': './languages/git-rebase.language-configuration.json'
+					},
+					{
+						'id': 'ignore',
+						'aliases': [
+							'Ignore',
+							'ignore'
+						],
+						'extensions': [
+							'.gitignore_global',
+							'.gitignore'
+						],
+						'configuration': './languages/ignore.language-configuration.json'
+					}
+				],
+				'grammars': [
+					{
+						'language': 'git-commit',
+						'scopeName': 'text.git-commit',
+						'path': './syntaxes/git-commit.tmLanguage.json'
+					},
+					{
+						'language': 'git-rebase',
+						'scopeName': 'text.git-rebase',
+						'path': './syntaxes/git-rebase.tmLanguage.json'
+					},
+					{
+						'language': 'ignore',
+						'scopeName': 'source.ignore',
+						'path': './syntaxes/ignore.tmLanguage.json'
+					}
+				]
+			},
+			'devDependencies': {
+				'@types/node': '16.x'
+			},
+			'repository': {
+				'type': 'git',
+				'url': 'https://github.com/microsoft/vscode.git'
+			}
+		};
+		r.push({
+			type: ExtensionType.System,
+			isBuiltin: true,
+			identifier: { id: 'vscode.git-base' },
+			manifest,
+			location: URI.parse('http://localhost/oss-dev/static/extensions/git-base'),
+			targetPlatform: TargetPlatform.WEB,
+			isValid: true,
+			validations: [],
+		});
+		return r;
 	}
 
 	private async localizeManifest(extensionId: string, manifest: IExtensionManifest, fallbackTranslations: ITranslations): Promise<IExtensionManifest> {
  • run yarn watch
  • run yarn watch-web
  • run ./scripts/code-server.sh
  • open the localhost:9888 link
  • check the output channels
  • Extension Host (Remote) should show somewhere "ExtensionService#_doActivateExtension vscode.git-base, startup: true"
  • Extension Host (Worker) should not show that it activates vscode.git-base.

@jeanp413 Could you please also give it a try? Thank you!

@alexdima alexdima closed this as completed Jun 2, 2023
@sandy081 sandy081 added the verified Verification succeeded label Jun 2, 2023
@TylerLeonhardt
Copy link
Member

This is the related bug that I think @connor4312 meant
#183754

@jeanp413
Copy link
Contributor Author

jeanp413 commented Jun 2, 2023

@alexdima yep it's fixed 馃憤

@github-actions github-actions bot locked and limited conversation to collaborators Jul 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release regression Something that used to work is now broken verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants