Skip to content

Commit

Permalink
Avoid sending an "empty" (lacking project data) startup event.
Browse files Browse the repository at this point in the history
- When the language server import takes too long (>60s), an "empty"
  startup event is sent to at least capture some data. This can result
  in duplicate events when a project import finally completes, or a
  (now) useless event if something goes wrong.
- Avoid sending such events as there are better ways to determine if the
  language server encountered an error

Signed-off-by: Roland Grunberg <[email protected]>
  • Loading branch information
rgrunber committed May 29, 2024
1 parent 248e976 commit d369638
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export namespace Telemetry {
export const SERVER_INITIALIZED_EVT = "java.workspace.initialized";
export const LS_ERROR = "java.ls.error";
let telemetryManager: TelemetryService = null;
let serverInitializedReceived = false;

/**
* Starts the telemetry service
Expand All @@ -26,7 +25,6 @@ export namespace Telemetry {
const redhatService = await getRedHatService(context);
const telemService = await redhatService.getTelemetryService();
telemetryManager = telemService;
setTimeout(sendEmptyStartUp, 60000); // assume LS may not have initialized
return telemService;
}

Expand All @@ -45,7 +43,6 @@ export namespace Telemetry {

let properties: any;
if (eventName === STARTUP_EVT) {
serverInitializedReceived = true;
properties= { ...data, ...javaSettings };
} else {
properties= { ...data};
Expand All @@ -57,12 +54,6 @@ export namespace Telemetry {
});
}

function sendEmptyStartUp() {
if (!serverInitializedReceived) {
return sendTelemetry(STARTUP_EVT);
}
}

function getJavaSettingsForTelemetry(config: WorkspaceConfiguration) {
// settings whose values we can record
const SETTINGS_BASIC = [
Expand Down

0 comments on commit d369638

Please sign in to comment.