diff --git a/src/vs/server/node/pwbHeartbeat.ts b/src/vs/server/node/pwbHeartbeat.ts index f30b0be0dee..82015b042b2 100644 --- a/src/vs/server/node/pwbHeartbeat.ts +++ b/src/vs/server/node/pwbHeartbeat.ts @@ -1,6 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (C) 2023-2025 Posit Software, PBC. All rights reserved. + * Licensed under the Elastic License 2.0. See LICENSE.txt for license information. + *--------------------------------------------------------------------------------------------*/ import { createDecorator } from '../../../vs/platform/instantiation/common/instantiation.js'; import { registerSingleton } from '../../../vs/platform/instantiation/common/extensions.js'; -import { SyncDescriptor } from '../../../vs/platform/instantiation/common/descriptors'; +import { SyncDescriptor } from '../../../vs/platform/instantiation/common/descriptors.js'; import * as constants from './pwbConstants.js'; export const IPwbHeartbeatService = createDecorator('pwbHeartbeatService'); diff --git a/src/vs/server/node/remoteExtensionHostAgentServer.ts b/src/vs/server/node/remoteExtensionHostAgentServer.ts index d40f49fbd28..553995c2471 100644 --- a/src/vs/server/node/remoteExtensionHostAgentServer.ts +++ b/src/vs/server/node/remoteExtensionHostAgentServer.ts @@ -50,7 +50,7 @@ import { MandatoryServerConnectionToken } from './serverConnectionToken.js'; // --- End Positron --- // --- Start PWB: Server proxy support --- -import { kProxyRegex } from './pwbConstants.js'; +import { kProxyRegex, kSessionUrl } from './pwbConstants.js'; import { IPwbHeartbeatService } from './pwbHeartbeat.js'; // --- End PWB --- @@ -852,11 +852,14 @@ export async function createServer(address: string | net.AddressInfo | null, arg // -- End PWB: SSL support // -- Start PWB: Heartbeat - instantiationService.invokeFunction(async (accessor) => { - const pwbHeartbeatService = accessor.get(IPwbHeartbeatService); + // Inside a Posit Workbench session, send an initial heartbeat. + if (kSessionUrl) { + instantiationService.invokeFunction(async (accessor) => { + const pwbHeartbeatService = accessor.get(IPwbHeartbeatService); - pwbHeartbeatService.sendInitialHeartbeat(); - }); + pwbHeartbeatService.sendInitialHeartbeat(); + }); + } // -- End PWB: Heartbeat }