Skip to content

Commit bd5ab33

Browse files
committed
chore(glean): Remove unused glean metric for webauthn
Because: * We are not using this metric This commit: * Removes webauthn capability probe Closes #FXA-13423
1 parent 4e21b04 commit bd5ab33

9 files changed

Lines changed: 15 additions & 442 deletions

File tree

packages/fxa-settings/src/components/App/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ import {
3939
import { AccountStateProvider } from '../../models/contexts/AccountStateContext';
4040

4141
import sentryMetrics from 'fxa-shared/sentry/browser';
42-
import { maybeRecordWebAuthnCapabilities } from '../../lib/webauthnCapabilitiesProbe';
43-
4442
// Components
4543
import LoadingSpinner from 'fxa-react/components/LoadingSpinner';
4644
import { ScrollToTop } from '../Settings/ScrollToTop';
@@ -361,7 +359,6 @@ export const App = ({
361359
useEffect(() => {
362360
if (metricsEnabled || isSignedIn === false) {
363361
sentryMetrics.enable();
364-
maybeRecordWebAuthnCapabilities();
365362
} else {
366363
sentryMetrics.disable();
367364
}

packages/fxa-settings/src/lib/glean/index.test.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ import {
2828
} from 'fxa-shared/metrics/glean/web/session';
2929
import * as utm from 'fxa-shared/metrics/glean/web/utm';
3030
import * as entrypointQuery from 'fxa-shared/metrics/glean/web/entrypoint';
31-
import * as webauthn from 'fxa-shared/metrics/glean/web/webauthn';
32-
3331
import { Config } from '../config';
3432
import { WebIntegration, useAccount, WebIntegrationData } from '../../models';
3533
import { MetricsFlow } from '../metrics-flow';
@@ -1134,30 +1132,6 @@ describe('lib/glean', () => {
11341132
sinon.assert.calledOnce(spy);
11351133
});
11361134
});
1137-
1138-
describe('webauthn', () => {
1139-
it('stringifies extras to strings before recording', async () => {
1140-
const spy = sandbox.spy(webauthn.capabilities, 'record');
1141-
GleanMetrics.setEnabled(true);
1142-
GleanMetrics.webauthn.capabilities({
1143-
event: {
1144-
supported: true,
1145-
ppa: true,
1146-
cg: false,
1147-
error_reason: 'foo',
1148-
os_family: 'windows',
1149-
} as any,
1150-
});
1151-
await GleanMetrics.isDone();
1152-
sinon.assert.calledOnce(spy);
1153-
const arg = spy.getCall(0).args[0]!;
1154-
expect(arg.supported).toBe('true');
1155-
expect(arg.ppa).toBe('true');
1156-
expect(arg.cg).toBe('false');
1157-
expect(arg.error_reason).toBe('foo');
1158-
expect(arg.os_family).toBe('windows');
1159-
});
1160-
});
11611135
});
11621136

11631137
describe('toggle enabled state', () => {

packages/fxa-settings/src/lib/glean/index.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import {
4949
} from 'fxa-shared/metrics/glean/web/session';
5050
import * as utm from 'fxa-shared/metrics/glean/web/utm';
5151
import * as entrypointQuery from 'fxa-shared/metrics/glean/web/entrypoint';
52-
import * as webauthn from 'fxa-shared/metrics/glean/web/webauthn';
5352
import { Integration } from '../../models';
5453
import { MetricsFlow } from '../metrics-flow';
5554
import { currentAccount } from '../../lib/cache';
@@ -677,32 +676,6 @@ const recordEventMetric = (
677676
case 'third_party_auth_set_password_success':
678677
thirdPartyAuthSetPassword.success.record();
679678
break;
680-
case 'webauthn_capabilities': {
681-
const e = (gleanPingMetrics as any).event || {};
682-
// Always coerce expected extras to strings to ensure they appear in Looker "Events Extras"
683-
const extras: Record<string, string> = {};
684-
const allKeys = [
685-
'supported',
686-
'ppa',
687-
'cg',
688-
'rel',
689-
'hyb',
690-
'uvpa',
691-
'prf',
692-
'error_reason',
693-
'os_family',
694-
'os_major',
695-
'browser_family',
696-
'browser_major',
697-
] as const;
698-
for (const key of allKeys) {
699-
if (e[key] !== undefined) {
700-
extras[key] = String(e[key]);
701-
}
702-
}
703-
webauthn.capabilities.record(extras as any);
704-
break;
705-
}
706679
case 'promo_qr_mobile_view':
707680
promoQrMobile.view.record();
708681
break;

packages/fxa-settings/src/lib/webauthnCapabilitiesProbe.test.ts

Lines changed: 0 additions & 117 deletions
This file was deleted.

packages/fxa-settings/src/lib/webauthnCapabilitiesProbe.ts

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)