fix(Glean): use the configured app channel for Glean in Settings

Because:
 - Glean in Settings was initialized with the default "development"
   value

This commit:
 - uses the actual configuration value for the app channel
This commit is contained in:
Barry Chen 2024-09-03 17:22:31 -05:00
Родитель 6f4aa7a45c
Коммит 85d94551dd
Не найден ключ, соответствующий данной подписи
6 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -218,7 +218,7 @@ describe('glean', () => {
...config.glean,
enabled: mockMetricsQueryAccountGlean.metricsEnabled,
appDisplayVersion: config.version,
channel: config.glean.channel,
appChannel: config.glean.appChannel,
},
{
metricsFlow: updatedFlowQueryParams,

Просмотреть файл

@ -173,7 +173,7 @@ export const App = ({
...config.glean,
enabled: metricsEnabled,
appDisplayVersion: config.version,
channel: config.glean.channel,
appChannel: config.glean.appChannel,
},
{
metricsFlow,

Просмотреть файл

@ -72,7 +72,7 @@ export interface Config {
applicationId: string;
uploadEnabled: boolean;
appDisplayVersion: string;
channel: string;
appChannel: string;
serverEndpoint: string;
logPings: boolean;
debugViewTag: string;
@ -153,7 +153,7 @@ export function getDefault() {
enabled: false,
applicationId: 'accounts_frontend_dev',
uploadEnabled: true,
channel: 'development',
appChannel: 'development',
serverEndpoint: 'https://incoming.telemetry.mozilla.org',
logPings: false,
debugViewTag: '',

Просмотреть файл

@ -38,7 +38,7 @@ const mockConfig: Config['glean'] = {
applicationId: 'testo',
uploadEnabled: true,
appDisplayVersion: '9001',
channel: 'test',
appChannel: 'test',
serverEndpoint: 'https://metrics.example.io/',
logPings: false,
debugViewTag: '',
@ -195,7 +195,7 @@ describe('lib/glean', () => {
mockConfig.uploadEnabled,
{
appDisplayVersion: mockConfig.appDisplayVersion,
channel: mockConfig.channel,
channel: mockConfig.appChannel,
serverEndpoint: mockConfig.serverEndpoint,
enableAutoPageLoadEvents: true,
enableAutoElementClickEvents: true,

Просмотреть файл

@ -539,7 +539,7 @@ export const GleanMetrics: Pick<
if (config.enabled) {
Glean.initialize(config.applicationId, config.uploadEnabled, {
appDisplayVersion: config.appDisplayVersion,
channel: config.channel,
channel: config.appChannel,
serverEndpoint: config.serverEndpoint,
enableAutoPageLoadEvents: true,
enableAutoElementClickEvents: true,

Просмотреть файл

@ -7,7 +7,7 @@ export type GleanMetricsConfig = {
applicationId: string;
uploadEnabled: boolean;
appDisplayVersion: string;
channel: string;
appChannel: string;
serverEndpoint: string;
logPings: boolean;
debugViewTag: string;