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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Positron Web boot: only send a heartbeat in Workbench sessions #6072

Open
wants to merge 1 commit into
base: prerelease/2025.01
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/vs/server/node/pwbHeartbeat.ts
Original file line number Diff line number Diff line change
@@ -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<IPwbHeartbeatService>('pwbHeartbeatService');
Expand Down
13 changes: 8 additions & 5 deletions src/vs/server/node/remoteExtensionHostAgentServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---

Expand Down Expand Up @@ -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
}

Expand Down
Loading