Skip to content

Commit 0104bc4

Browse files
committed
chore(telemetry): satisfy CI lint and prettier
- Apply prettier to TelemetryClientProvider.test.ts (sed-edits in the prior commit didn't preserve formatting). - Silence eslint `no-await-in-loop` on the auth-context fall-through in TelemetryClient.getConnectionProvider — sequential by intent. - Drop the empty public constructor on TelemetryClientProvider; leave a comment explaining the singleton + test-friendly construction contract. Co-authored-by: Isaac
1 parent 7395026 commit 0104bc4

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

lib/telemetry/TelemetryClient.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ class TelemetryClient implements IClientContext {
130130
let lastErr: unknown;
131131
for (const ctx of this.contexts) {
132132
try {
133+
// Sequential fall-through is intentional — each context returns the
134+
// same shared connection provider; we try the next registrant only
135+
// when the current head is unusable.
136+
// eslint-disable-next-line no-await-in-loop
133137
return await ctx.getConnectionProvider();
134138
} catch (err) {
135139
lastErr = err;

lib/telemetry/TelemetryClientProvider.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,10 @@ class TelemetryClientProvider {
4949

5050
private softLimitWarned = false;
5151

52-
/**
53-
* Production code should use `TelemetryClientProvider.getInstance()` for
54-
* the process-wide singleton. The constructor remains public for unit
55-
* tests that need an isolated provider with its own map.
56-
*/
57-
public constructor() {}
52+
// Production code should use `TelemetryClientProvider.getInstance()` for
53+
// the process-wide singleton. The constructor remains public so unit tests
54+
// can build an isolated provider with its own map. Deliberate no-op body —
55+
// initial state is set inline on the field declarations above.
5856

5957
static getInstance(): TelemetryClientProvider {
6058
if (!TelemetryClientProvider.instance) {

tests/unit/telemetry/TelemetryClientProvider.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ describe('TelemetryClientProvider', () => {
3232

3333
expect(provider.getActiveClients().size).to.equal(0);
3434
});
35-
3635
});
3736

3837
describe('getOrCreateClient', () => {

0 commit comments

Comments
 (0)