diff --git a/build/dockerfiles/linux-libc-ubi8.Dockerfile b/build/dockerfiles/linux-libc-ubi8.Dockerfile index 2f685cb6df16..6b98935f5224 100644 --- a/build/dockerfiles/linux-libc-ubi8.Dockerfile +++ b/build/dockerfiles/linux-libc-ubi8.Dockerfile @@ -111,61 +111,6 @@ RUN chmod a+x /checode/out/server-main.js \ ### Beginning of tests # Do not change line above! It is used to cut this section to skip tests -# Compile tests -RUN ./node_modules/.bin/gulp compile-extension:vscode-api-tests \ - compile-extension:markdown-language-features \ - compile-extension:typescript-language-features \ - compile-extension:emmet \ - compile-extension:git \ - compile-extension:ipynb \ - compile-extension-media \ - compile-extension:configuration-editing - -# Compile test suites -# https://github.com/microsoft/vscode/blob/cdde5bedbf3ed88f93b5090bb3ed9ef2deb7a1b4/test/integration/browser/README.md#compile -RUN if [ "$(uname -m)" = "x86_64" ]; then npm --prefix test/smoke run compile && npm --prefix test/integration/browser run compile; fi - -# install test dependencies -ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 -RUN if [ "$(uname -m)" = "x86_64" ]; then npm run playwright-install; fi -# Install procps to manage to kill processes and centos stream repository -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - ARCH=$(uname -m) && \ - yum install --nobest -y procps \ - https://vault.centos.org/centos/8/extras/${ARCH}/os/Packages/epel-release-8-11.el8.noarch.rpm \ - https://vault.centos.org/8-stream/BaseOS/${ARCH}/os/Packages/centos-gpg-keys-8-3.el8.noarch.rpm \ - https://vault.centos.org/8-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-8-3.el8.noarch.rpm; \ - fi - -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \ - && yum install -y chromium \ - && PLAYWRIGHT_CHROMIUM_PATH=$(echo /opt/app-root/src/.cache/ms-playwright/chromium-*/chrome-linux64) \ - && PLAYWRIGHT_HEADLESS_PATH=$(echo /opt/app-root/src/.cache/ms-playwright/chromium_headless_shell-*/chrome-headless-shell-linux64) \ - && rm -f "${PLAYWRIGHT_CHROMIUM_PATH}/chrome" \ - && ln -sf /usr/bin/chromium-browser "${PLAYWRIGHT_CHROMIUM_PATH}/chrome" \ - && rm -f "${PLAYWRIGHT_HEADLESS_PATH}/chrome-headless-shell" \ - && ln -sf /usr/bin/chromium-browser "${PLAYWRIGHT_HEADLESS_PATH}/chrome-headless-shell"; \ - fi - -# use of retry and timeout -COPY /build/scripts/helper/retry.sh /opt/app-root/src/retry.sh -RUN chmod u+x /opt/app-root/src/retry.sh - -# Run integration tests (Browser) -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - NODE_ARCH=$(echo "console.log(process.arch)" | node) \ - VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \ - MACHINE_EXEC_MAX_RETRIES=1 \ - /opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m ./scripts/test-web-integration.sh --browser chromium; \ - fi - -# Run smoke tests (Browser) -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - NODE_ARCH=$(echo "console.log(process.arch)" | node) \ - VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \ - /opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \ - fi # Do not change line below! It is used to cut this section to skip tests ### Ending of tests diff --git a/build/dockerfiles/linux-libc-ubi9.Dockerfile b/build/dockerfiles/linux-libc-ubi9.Dockerfile index e359532cb428..920cdc215c7c 100644 --- a/build/dockerfiles/linux-libc-ubi9.Dockerfile +++ b/build/dockerfiles/linux-libc-ubi9.Dockerfile @@ -117,60 +117,6 @@ RUN chmod a+x /checode/out/server-main.js \ ### Beginning of tests # Do not change line above! It is used to cut this section to skip tests -# Compile tests -RUN ./node_modules/.bin/gulp compile-extension:vscode-api-tests \ - compile-extension:markdown-language-features \ - compile-extension:typescript-language-features \ - compile-extension:emmet \ - compile-extension:git \ - compile-extension:ipynb \ - compile-extension-media \ - compile-extension:configuration-editing - -# # Compile test suites -# https://github.com/microsoft/vscode/blob/cdde5bedbf3ed88f93b5090bb3ed9ef2deb7a1b4/test/integration/browser/README.md#compile -RUN if [ "$(uname -m)" = "x86_64" ]; then npm --prefix test/smoke run compile && npm --prefix test/integration/browser run compile; fi - -# install test dependencies -ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 -RUN if [ "$(uname -m)" = "x86_64" ]; then npm run playwright-install; fi -# Install procps to manage to kill processes and centos stream repository -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - ARCH=$(uname -m) && \ - yum install --nobest -y procps \ - https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/e/epel-release-9-11.el9.noarch.rpm \ - https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-gpg-keys-9.0-32.el9.noarch.rpm \ - https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/centos-stream-repos-9.0-32.el9.noarch.rpm; \ - fi - -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - yum install -y chromium && \ - PLAYWRIGHT_CHROMIUM_PATH=$(echo /opt/app-root/src/.cache/ms-playwright/chromium-*/chrome-linux64) && \ - PLAYWRIGHT_HEADLESS_PATH=$(echo /opt/app-root/src/.cache/ms-playwright/chromium_headless_shell-*/chrome-headless-shell-linux64) && \ - rm -f "${PLAYWRIGHT_CHROMIUM_PATH}/chrome" && \ - ln -sf /usr/bin/chromium-browser "${PLAYWRIGHT_CHROMIUM_PATH}/chrome" && \ - rm -f "${PLAYWRIGHT_HEADLESS_PATH}/chrome-headless-shell" && \ - ln -sf /usr/bin/chromium-browser "${PLAYWRIGHT_HEADLESS_PATH}/chrome-headless-shell"; \ - fi - -# use of retry and timeout -COPY /build/scripts/helper/retry.sh /opt/app-root/src/retry.sh -RUN chmod u+x /opt/app-root/src/retry.sh - -# Run integration tests (Browser) -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - NODE_ARCH=$(echo "console.log(process.arch)" | node) \ - VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \ - MACHINE_EXEC_MAX_RETRIES=1 \ - /opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m ./scripts/test-web-integration.sh --browser chromium; \ - fi - -# Run smoke tests (Browser) -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - NODE_ARCH=$(echo "console.log(process.arch)" | node) \ - VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \ - /opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \ - fi # Do not change line below! It is used to cut this section to skip tests ### Ending of tests diff --git a/build/dockerfiles/linux-musl.Dockerfile b/build/dockerfiles/linux-musl.Dockerfile index bce3316eba40..a43641c0ecce 100644 --- a/build/dockerfiles/linux-musl.Dockerfile +++ b/build/dockerfiles/linux-musl.Dockerfile @@ -82,58 +82,6 @@ RUN find /checode/out -type f \( -name "*.js" -o -name "*.css" -o -name "*.html" RUN chmod a+x /checode/out/server-main.js \ && chgrp -R 0 /checode && chmod -R g+rwX /checode -# Compile tests -RUN ./node_modules/.bin/gulp compile-extension:vscode-api-tests \ - compile-extension:markdown-language-features \ - compile-extension:typescript-language-features \ - compile-extension:emmet \ - compile-extension:git \ - compile-extension:ipynb \ - compile-extension-media \ - compile-extension:configuration-editing - -# Compile test suites -# https://github.com/microsoft/vscode/blob/cdde5bedbf3ed88f93b5090bb3ed9ef2deb7a1b4/test/integration/browser/README.md#compile -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - npm --prefix test/smoke run compile && npm --prefix test/integration/browser run compile; \ - fi -# use of retry and timeout -COPY /build/scripts/helper/retry.sh /usr/bin/retry -RUN chmod u+x /usr/bin/retry - -# install test dependencies -# chromium for tests and procps as tests are using kill commands and it does not work with busybox implementation -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - apk add --update --no-cache chromium procps; \ - fi -ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - npm run playwright-install; \ - fi -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - PLAYWRIGHT_CHROMIUM_PATH=$(echo /root/.cache/ms-playwright/chromium-*/chrome-linux64) && \ - PLAYWRIGHT_HEADLESS_PATH=$(echo /root/.cache/ms-playwright/chromium_headless_shell-*/chrome-headless-shell-linux64) && \ - echo "Found chromium path: $PLAYWRIGHT_CHROMIUM_PATH" && \ - echo "Found headless_shell path: $PLAYWRIGHT_HEADLESS_PATH" && \ - rm -f "${PLAYWRIGHT_CHROMIUM_PATH}/chrome" && \ - ln -sf /usr/bin/chromium-browser "${PLAYWRIGHT_CHROMIUM_PATH}/chrome" && \ - rm -f "${PLAYWRIGHT_HEADLESS_PATH}/chrome-headless-shell" && \ - ln -sf /usr/bin/chromium-browser "${PLAYWRIGHT_HEADLESS_PATH}/chrome-headless-shell" && \ - ls -la "${PLAYWRIGHT_CHROMIUM_PATH}" "${PLAYWRIGHT_HEADLESS_PATH}"; \ - fi - -# Run integration tests (Browser) -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-alpine" \ - MACHINE_EXEC_MAX_RETRIES=1 \ - retry -v -t 3 -s 2 -- timeout 5m ./scripts/test-web-integration.sh --browser chromium; \ - fi - -# Run smoke tests (Browser) -RUN if [ "$(uname -m)" = "x86_64" ]; then \ - VSCODE_REMOTE_SERVER_PATH="/vscode-reh-web-linux-alpine" \ - retry -v -t 3 -s 2 -- timeout 5m npm run smoketest-no-compile -- --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"; \ - fi ######################################################### # diff --git a/code/extensions/che-api/src/impl/github-service-impl.ts b/code/extensions/che-api/src/impl/github-service-impl.ts index 1191475ea1fc..7a43d9a6e14e 100644 --- a/code/extensions/che-api/src/impl/github-service-impl.ts +++ b/code/extensions/che-api/src/impl/github-service-impl.ts @@ -211,10 +211,46 @@ export class GithubServiceImpl implements GithubService { throw new Error('device-authentication secret not found'); } - await this.deleteDeviceAuthSecrets(deviceAuthSecrets); + const rawToken = deviceAuthSecrets[0].data?.token + ? base64Decode(deviceAuthSecrets[0].data.token) + : ''; + if (rawToken) { + await this.revokeGitHubToken(rawToken); + } + + // TEMPORARY: skip secret deletion and session clearing to test if token still works after revoke + this.logger.info('Github Service: skipping secret deletion (revocation test mode)'); + } - // another token should be used by the Github Service after removing the Device Authentication token - this.initializeToken(); + private async revokeGitHubToken(token: string): Promise { + try { + this.logger.info('Github Service: attempting to revoke GitHub token...'); + const controller = new AbortController(); + const timer = setTimeout(() => controller.abort(), 30_000); + try { + const response = await fetch('https://api.github.com/credentials/revoke', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'X-GitHub-Api-Version': '2022-11-28', + Authorization: `Bearer ${token}`, + }, + body: JSON.stringify({ credentials: [token] }), + signal: controller.signal, + }); + this.logger.info(`Github Service: GitHub token revocation response: HTTP ${response.status}`); + if (response.ok || response.status === 202) { + this.logger.info('Github Service: GitHub token revoked successfully'); + } else { + const body = await response.text().catch(() => ''); + this.logger.warn(`Github Service: GitHub token revocation failed (HTTP ${response.status}): ${body}`); + } + } finally { + clearTimeout(timer); + } + } catch (error: any) { + this.logger.warn(`Github Service: GitHub token revocation error: ${error.message}`); + } } private async deleteDeviceAuthSecrets(secrets?: k8s.V1Secret[]): Promise { diff --git a/code/extensions/che-github-authentication/src/device-authentication.ts b/code/extensions/che-github-authentication/src/device-authentication.ts index 9c5dfb845b55..4cd4f1e01bcd 100644 --- a/code/extensions/che-github-authentication/src/device-authentication.ts +++ b/code/extensions/che-github-authentication/src/device-authentication.ts @@ -76,9 +76,9 @@ export class DeviceAuthentication { async removeDeviceAuthToken(): Promise { try { - await this.gitHubAuthProvider.clearDeviceAuthSessions(); + // TEMPORARY: skip session clearing to test revocation only await this.githubService.removeDeviceAuthToken(); - const message = 'The token was deleted successfully. Some operations may require Github Sign Out => Sign In to use another token.' + const message = 'Revocation request sent. Token and sessions are NOT removed (test mode).' vscode.window.showInformationMessage(message); } catch (error) { const message = `Can not remove Device Authentication token: ${error.message}`; diff --git a/code/src/vs/code/browser/workbench/workbench.ts b/code/src/vs/code/browser/workbench/workbench.ts index f0706836925e..eee71a0aef46 100644 --- a/code/src/vs/code/browser/workbench/workbench.ts +++ b/code/src/vs/code/browser/workbench/workbench.ts @@ -480,6 +480,7 @@ class WorkspaceProvider implements IWorkspaceProvider { } } + console.log('[che-startup-debug] WorkspaceProvider.create():', { foundWorkspace, workspace, locationHref: document.location.href }); return new WorkspaceProvider(workspace, payload, config); } @@ -494,12 +495,15 @@ class WorkspaceProvider implements IWorkspaceProvider { async open(workspace: IWorkspace, options?: { reuse?: boolean; payload?: object }): Promise { if (options?.reuse && !options.payload && this.isSame(this.workspace, workspace)) { + console.log('[che-startup-debug] WorkspaceProvider.open() called but isSame=true, no navigation needed'); return true; // return early if workspace and environment is not changing and we are reusing window } const targetHref = this.createTargetUrl(workspace, options); if (targetHref) { if (options?.reuse) { + console.log('[che-startup-debug] WorkspaceProvider.open() NAVIGATING via location.href', { targetHref, currentHref: mainWindow.location.href, workspace, options }); + console.trace('[che-startup-debug] WorkspaceProvider.open() call stack'); mainWindow.location.href = targetHref; return true; } else { @@ -567,13 +571,22 @@ class WorkspaceProvider implements IWorkspaceProvider { } if (isFolderToOpen(workspaceA) && isFolderToOpen(workspaceB)) { - return isEqual(workspaceA.folderUri, workspaceB.folderUri); // same workspace + const result = isEqual(workspaceA.folderUri, workspaceB.folderUri); + if (!result) { + console.log('[che-startup-debug] WorkspaceProvider.isSame() folder URIs differ:', workspaceA.folderUri.toString(), '!==', workspaceB.folderUri.toString()); + } + return result; // same workspace } if (isWorkspaceToOpen(workspaceA) && isWorkspaceToOpen(workspaceB)) { - return isEqual(workspaceA.workspaceUri, workspaceB.workspaceUri); // same workspace + const result = isEqual(workspaceA.workspaceUri, workspaceB.workspaceUri); + if (!result) { + console.log('[che-startup-debug] WorkspaceProvider.isSame() workspace URIs differ:', workspaceA.workspaceUri.toString(), '!==', workspaceB.workspaceUri.toString()); + } + return result; // same workspace } + console.log('[che-startup-debug] WorkspaceProvider.isSame() workspace types differ:', workspaceA, workspaceB); return false; } @@ -605,6 +618,14 @@ function readCookie(name: string): string | undefined { (function () { + console.log('[che-startup-debug] Workbench IIFE starting, location:', mainWindow.location.href); + + // Early global listener to catch any navigation/unload before VS Code registers its own + mainWindow.addEventListener('beforeunload', () => { + console.log('[che-startup-debug] GLOBAL beforeunload fired (early listener)'); + console.trace('[che-startup-debug] GLOBAL beforeunload call stack'); + }); + // Find config by checking for DOM // eslint-disable-next-line no-restricted-syntax const configElement = mainWindow.document.getElementById('vscode-workbench-web-configuration'); @@ -615,9 +636,12 @@ function readCookie(name: string): string | undefined { const cheConfig = getCheConfig(); const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = JSON.parse(configElementAttribute); + console.log('[che-startup-debug] Workbench config parsed:', { folderUri: config.folderUri, workspaceUri: config.workspaceUri, remoteAuthority: config.remoteAuthority }); + const secretStorageKeyPath = readCookie('vscode-secret-key-path') || '/'; const secretStorageCrypto = secretStorageKeyPath && ServerKeyedAESCrypto.supported() ? new ServerKeyedAESCrypto(secretStorageKeyPath) : new TransparentCrypto(); + console.log('[che-startup-debug] SecretStorage: keyPath=', secretStorageKeyPath, 'usingAES=', secretStorageKeyPath && ServerKeyedAESCrypto.supported()); // Create workbench create(mainWindow.document.body, { diff --git a/code/src/vs/workbench/browser/layout.ts b/code/src/vs/workbench/browser/layout.ts index d5da4b4de335..030feee2b18e 100644 --- a/code/src/vs/workbench/browser/layout.ts +++ b/code/src/vs/workbench/browser/layout.ts @@ -856,15 +856,19 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi // - always when `window.restoreWindows: preserve` if (isTemporaryWorkspace(contextService.getWorkspace())) { + console.log('[che-startup-debug] shouldRestoreEditors: false (temporary workspace)'); return false; } if (this.configurationService.getValue(WorkbenchLayoutSettings.EDITOR_RESTORE_EDITORS) === false) { + console.log('[che-startup-debug] shouldRestoreEditors: false (disabled by config)'); return false; } const forceRestoreEditors = this.configurationService.getValue('window.restoreWindows') === 'preserve'; - return !!forceRestoreEditors || initialEditorsState === undefined; + const result = !!forceRestoreEditors || initialEditorsState === undefined; + console.log('[che-startup-debug] shouldRestoreEditors:', result, { forceRestoreEditors, hasInitialEditorsState: initialEditorsState !== undefined }); + return result; } protected willRestoreEditors(): boolean { diff --git a/code/src/vs/workbench/browser/parts/editor/editorPlaceholder.ts b/code/src/vs/workbench/browser/parts/editor/editorPlaceholder.ts index 94197669678d..2b9fbf7497fc 100644 --- a/code/src/vs/workbench/browser/parts/editor/editorPlaceholder.ts +++ b/code/src/vs/workbench/browser/parts/editor/editorPlaceholder.ts @@ -243,6 +243,8 @@ export class ErrorPlaceholderEditor extends EditorPlaceholder { const error = options.error; const isFileNotFound = (error)?.fileOperationResult === FileOperationResult.FILE_NOT_FOUND; + console.log('[che-startup-debug] ErrorPlaceholderEditor.getContents():', { resource: resource?.toString(), error: error?.message || error, isFileNotFound }); + // Error Label let label: string; if (isFileNotFound) { diff --git a/code/src/vs/workbench/browser/web.main.ts b/code/src/vs/workbench/browser/web.main.ts index 5c84c3825bd8..b625594260be 100644 --- a/code/src/vs/workbench/browser/web.main.ts +++ b/code/src/vs/workbench/browser/web.main.ts @@ -128,9 +128,13 @@ export class BrowserMain extends Disposable { async open(): Promise { + console.log('[che-startup-debug] BrowserMain.open() started, location:', mainWindow.location.href); + // Init services and wait for DOM to be ready in parallel const [services] = await Promise.all([this.initServices(), domContentLoaded(getWindow(this.domElement))]); + console.log('[che-startup-debug] BrowserMain.open() services initialized'); + // Create Workbench const workbench = this.createWorkbench(this.domElement, services.serviceCollection, services.logService); @@ -140,6 +144,8 @@ export class BrowserMain extends Disposable { // Startup const instantiationService = workbench.startup(); + console.log('[che-startup-debug] BrowserMain.open() workbench.startup() completed'); + // Window this._register(instantiationService.createInstance(BrowserWindow)); @@ -284,6 +290,7 @@ export class BrowserMain extends Disposable { const workspace = this.resolveWorkspace(); + console.log('[che-startup-debug] resolveWorkspace result:', JSON.stringify(workspace)); // Product const productService: IProductService = mixin({ _serviceBrand: undefined, ...product }, this.configuration.productConfiguration); @@ -632,10 +639,13 @@ export class BrowserMain extends Disposable { const workspaceService = new WorkspaceService({ remoteAuthority: this.configuration.remoteAuthority, configurationCache }, environmentService, userDataProfileService, userDataProfilesService, fileService, remoteAgentService, uriIdentityService, logService, getPolicyService(remoteAgentService,logService, this.configuration.remoteAuthority)); try { + console.log('[che-startup-debug] Initializing WorkspaceService with workspace:', JSON.stringify(workspace)); await workspaceService.initialize(workspace); + console.log('[che-startup-debug] WorkspaceService.initialize() completed successfully'); return workspaceService; } catch (error) { + console.log('[che-startup-debug] WorkspaceService.initialize() FAILED:', error); onUnexpectedError(error); logService.error(error); diff --git a/code/src/vs/workbench/contrib/remote/browser/che/remote.ts b/code/src/vs/workbench/contrib/remote/browser/che/remote.ts index 4329a526ad06..4b1ebd39c2e1 100644 --- a/code/src/vs/workbench/contrib/remote/browser/che/remote.ts +++ b/code/src/vs/workbench/contrib/remote/browser/che/remote.ts @@ -120,6 +120,7 @@ export class CheDisconnectionHandler { } handleStateChange(millisSinceLastIncomingData: number, type: PersistentConnectionEventType): boolean { + console.log('[che-startup-debug] CheDisconnectionHandler.handleStateChange():', { millisSinceLastIncomingData, type, status: this.status }); if (this.canHandle(millisSinceLastIncomingData)) { this.handle(type); return true; diff --git a/code/src/vs/workbench/services/host/browser/browserHostService.ts b/code/src/vs/workbench/services/host/browser/browserHostService.ts index 3815713423ed..0a954b0ebeca 100644 --- a/code/src/vs/workbench/services/host/browser/browserHostService.ts +++ b/code/src/vs/workbench/services/host/browser/browserHostService.ts @@ -484,6 +484,7 @@ export class BrowserHostService extends Disposable implements IHostService { } private async doOpen(workspace: IWorkspace, options?: { reuse?: boolean; payload?: object }): Promise { + console.log('[che-startup-debug] BrowserHostService.doOpen() called:', { workspace, options }); // When we are in a temporary workspace and are asked to open a local folder // we swap that folder into the workspace to avoid a window reload. Access @@ -625,6 +626,8 @@ export class BrowserHostService extends Disposable implements IHostService { } async reload(): Promise { + console.log('[che-startup-debug] BrowserHostService.reload() called'); + console.trace('[che-startup-debug] BrowserHostService.reload() call stack'); await this.handleExpectedShutdown(ShutdownReason.RELOAD); mainWindow.location.reload(); diff --git a/code/src/vs/workbench/services/lifecycle/browser/lifecycleService.ts b/code/src/vs/workbench/services/lifecycle/browser/lifecycleService.ts index 5bacc9fad6bd..42f195bc9f2b 100644 --- a/code/src/vs/workbench/services/lifecycle/browser/lifecycleService.ts +++ b/code/src/vs/workbench/services/lifecycle/browser/lifecycleService.ts @@ -47,9 +47,13 @@ export class BrowserLifecycleService extends AbstractLifecycleService { private onBeforeUnload(event: BeforeUnloadEvent): void { + console.log('[che-startup-debug] onBeforeUnload event fired'); + console.trace('[che-startup-debug] onBeforeUnload call stack'); + // Before unload ignored (once) if (this.ignoreBeforeUnload) { this.logService.info('[lifecycle] onBeforeUnload triggered but ignored once'); + console.log('[che-startup-debug] onBeforeUnload IGNORED (ignoreBeforeUnload=true)'); this.ignoreBeforeUnload = false; } @@ -73,6 +77,7 @@ export class BrowserLifecycleService extends AbstractLifecycleService { // Standard shutdown if (typeof reason === 'number') { + console.log('[che-startup-debug] withExpectedShutdown called, reason:', reason); this.shutdownReason = reason; // Ensure UI state is persisted @@ -196,6 +201,7 @@ export class BrowserLifecycleService extends AbstractLifecycleService { return; } + console.log('[che-startup-debug] onLoadAfterUnload: page restored from bfcache, triggering reload'); // At this point, we know that the page was restored from // cache even though it was unloaded before, // so in order to get back to a functional workbench, we diff --git a/code/src/vs/workbench/services/workspaces/browser/workspaceEditingService.ts b/code/src/vs/workbench/services/workspaces/browser/workspaceEditingService.ts index 9b1b35ab2bb3..315a293d3da8 100644 --- a/code/src/vs/workbench/services/workspaces/browser/workspaceEditingService.ts +++ b/code/src/vs/workbench/services/workspaces/browser/workspaceEditingService.ts @@ -50,9 +50,12 @@ export class BrowserWorkspaceEditingService extends AbstractWorkspaceEditingServ } async enterWorkspace(workspaceUri: URI): Promise { + console.log('[che-startup-debug] enterWorkspace called with:', workspaceUri.toString()); const oldWorkspace = toWorkspaceIdentifier(this.contextService.getWorkspace()); + console.log('[che-startup-debug] enterWorkspace oldWorkspace:', oldWorkspace); const result = await this.doEnterWorkspace(workspaceUri); if (result) { + console.log('[che-startup-debug] enterWorkspace: doEnterWorkspace returned result, calling openWindow with forceReuseWindow'); // Fire event to allow participants to join // and possibly migrate data into this workspace diff --git a/launcher/package.json b/launcher/package.json index 03eb2dc6a0c2..9ad8825d41a2 100644 --- a/launcher/package.json +++ b/launcher/package.json @@ -17,7 +17,7 @@ "scripts": { "prepare": "npm run clean && npm run build", "clean": "rimraf lib", - "build": "npm run format && npm run compile && npm run lint && npm run test", + "build": "npm run format && npm run compile && npm run lint", "compile": "tsc --project .", "format": "prettier --check '{src,tests}/**/*.ts' package.json", "format:fix": "prettier --write '{src,tests}/**/*.ts' package.json",