Skip to content

Commit 150ee83

Browse files
committed
fix missing initial analytics events
1 parent 3245209 commit 150ee83

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

gitpod-shared/src/common/telemetry.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,26 @@ export class BaseTelemetryAppender implements ITelemetryAppender {
123123
this._exceptionQueue = [];
124124
}
125125

126+
private isInstantiating = false;
127+
126128
/**
127129
* Instantiates the telemetry client to make the appender "active"
128130
*/
129131
instantiateAppender(): void {
130-
if (this._isInstantiated) {
132+
if (this.isInstantiating || this._isInstantiated) {
131133
return;
132134
}
133-
this._isInstantiated = true;
135+
this.isInstantiating = true;
134136

135137
// Call the client factory to get the client and then let it know it's instatntiated
136138
this._clientFactory().then(client => {
137139
this._telemetryClient = client;
140+
this._isInstantiated = true;
138141
this._flushQueues();
139142
}).catch(err => {
140143
console.error(err);
144+
}).finally(() => {
145+
this.isInstantiating = false;
141146
});
142147
}
143148
}

0 commit comments

Comments
 (0)