From 86052947213e4c95503976717507c82bbda24346 Mon Sep 17 00:00:00 2001 From: Adam Brouwers-Harries Date: Wed, 24 May 2023 15:31:56 +0100 Subject: [PATCH 1/3] Add 'unique-string' as an available type for marker payloads and schemas --- docs-developer/CHANGELOG-formats.md | 4 +++ src/app-logic/constants.js | 2 +- src/components/tooltip/Marker.js | 7 +++- src/profile-logic/marker-schema.js | 35 +++++++++++++++---- src/selectors/per-thread/markers.js | 3 ++ .../__snapshots__/profile-view.test.js.snap | 2 +- .../profile-conversion.test.js.snap | 24 ++++++------- .../profile-upgrading.test.js.snap | 6 ++-- src/test/unit/marker-schema.test.js | 8 +++-- src/types/markers.js | 5 ++- 10 files changed, 69 insertions(+), 27 deletions(-) diff --git a/docs-developer/CHANGELOG-formats.md b/docs-developer/CHANGELOG-formats.md index 80d407e1da..82618307db 100644 --- a/docs-developer/CHANGELOG-formats.md +++ b/docs-developer/CHANGELOG-formats.md @@ -66,6 +66,10 @@ Older versions are not documented in this changelog but can be found in [process ## Gecko profile format +### Version 28 + +A new `unique-string` type has been added as part of the marker schema, allowing markers to carry unique-strings in their payloads. + ### Version 27 The `optimizations` field is removed from the `frameTable` schema. diff --git a/src/app-logic/constants.js b/src/app-logic/constants.js index 7b2f18768b..fbbcf7cf00 100644 --- a/src/app-logic/constants.js +++ b/src/app-logic/constants.js @@ -9,7 +9,7 @@ import type { MarkerPhase } from 'firefox-profiler/types'; // The current version of the Gecko profile format. // Please don't forget to update the gecko profile format changelog in // `docs-developer/CHANGELOG-formats.md`. -export const GECKO_PROFILE_VERSION = 27; +export const GECKO_PROFILE_VERSION = 28; // The current version of the "processed" profile format. // Please don't forget to update the processed profile format changelog in diff --git a/src/components/tooltip/Marker.js b/src/components/tooltip/Marker.js index bf8f4a5850..fec964cf69 100644 --- a/src/components/tooltip/Marker.js +++ b/src/components/tooltip/Marker.js @@ -251,7 +251,12 @@ class MarkerTooltipContents extends React.PureComponent { key={schema.name + '-' + key} label={label || key} > - {formatMarkupFromMarkerSchema(schema.name, format, value)} + {formatMarkupFromMarkerSchema( + schema.name, + format, + value, + thread.stringTable + )} ); } diff --git a/src/profile-logic/marker-schema.js b/src/profile-logic/marker-schema.js index 01c8d499f4..04a61a692b 100644 --- a/src/profile-logic/marker-schema.js +++ b/src/profile-logic/marker-schema.js @@ -23,7 +23,9 @@ import type { Marker, MarkerIndex, MarkerPayload, + Thread, } from 'firefox-profiler/types'; +import type { UniqueStringArray } from '../utils/unique-string-array'; /** * The marker schema comes from Gecko, and is embedded in the profile. However, @@ -142,6 +144,7 @@ export function getSchemaFromMarker( export function parseLabel( markerSchema: MarkerSchema, categories: CategoryList, + thread: Thread, label: string ): (Marker) => string { // Split the label on the "{key}" capture groups. @@ -262,7 +265,12 @@ export function parseLabel( return ''; } return format - ? formatFromMarkerSchema(markerSchema.name, format, value) + ? formatFromMarkerSchema( + markerSchema.name, + format, + value, + thread.stringTable + ) : value; }; } @@ -327,6 +335,7 @@ export function getLabelGetter( markerSchemaList: MarkerSchema[], markerSchemaByName: MarkerSchemaByName, categoryList: CategoryList, + thread: Thread, labelKey: LabelKey ): (MarkerIndex) => string { // Build up a list of label functions, that are tied to the schema name. @@ -334,7 +343,10 @@ export function getLabelGetter( for (const schema of markerSchemaList) { const labelString = schema[labelKey]; if (labelString) { - labelFns.set(schema.name, parseLabel(schema, categoryList, labelString)); + labelFns.set( + schema.name, + parseLabel(schema, categoryList, thread, labelString) + ); } } @@ -381,7 +393,8 @@ export function getLabelGetter( export function formatFromMarkerSchema( markerType: string, format: MarkerFormatType, - value: any + value: any, + stringTable: ?UniqueStringArray ): string { if (value === undefined || value === null) { console.warn( @@ -432,6 +445,14 @@ export function formatFromMarkerSchema( case 'string': // Make sure a non-empty string is returned here. return String(value) || '(empty)'; + case 'unique-string': + if (stringTable !== null && stringTable !== undefined) { + return stringTable.getString(value); + } + console.warn( + `Could not find marker table for index "${value}" in markertype "${markerType}"` + ); + return 'Null or undefined string table.'; case 'duration': case 'time': return formatTimestamp(value); @@ -479,14 +500,15 @@ const URL_SCHEME_REGEXP = /^http(s?):\/\//; export function formatMarkupFromMarkerSchema( markerType: string, format: MarkerFormatType, - value: any + value: any, + stringTable: ?UniqueStringArray ): React.Element | string { if (value === undefined || value === null) { console.warn(`Formatting ${value} for ${JSON.stringify(markerType)}`); return '(empty)'; } if (format !== 'url' && typeof format !== 'object' && format !== 'list') { - return formatFromMarkerSchema(markerType, format, value); + return formatFromMarkerSchema(markerType, format, value, stringTable); } if (typeof format === 'object') { switch (format.type) { @@ -526,7 +548,8 @@ export function formatMarkupFromMarkerSchema( {formatMarkupFromMarkerSchema( markerType, columns[i].type || 'string', - cell + cell, + stringTable )} ); diff --git a/src/selectors/per-thread/markers.js b/src/selectors/per-thread/markers.js index 3b0228b6e9..9f2ee7f7c7 100644 --- a/src/selectors/per-thread/markers.js +++ b/src/selectors/per-thread/markers.js @@ -414,6 +414,7 @@ export function getMarkerSelectorsPerThread( ProfileSelectors.getMarkerSchema, ProfileSelectors.getMarkerSchemaByName, ProfileSelectors.getCategories, + threadSelectors.getThread, () => 'tooltipLabel', getLabelGetter ); @@ -427,6 +428,7 @@ export function getMarkerSelectorsPerThread( ProfileSelectors.getMarkerSchema, ProfileSelectors.getMarkerSchemaByName, ProfileSelectors.getCategories, + threadSelectors.getThread, () => 'tableLabel', getLabelGetter ); @@ -440,6 +442,7 @@ export function getMarkerSelectorsPerThread( ProfileSelectors.getMarkerSchema, ProfileSelectors.getMarkerSchemaByName, ProfileSelectors.getCategories, + threadSelectors.getThread, () => 'chartLabel', getLabelGetter ); diff --git a/src/test/store/__snapshots__/profile-view.test.js.snap b/src/test/store/__snapshots__/profile-view.test.js.snap index 01b57d9cd5..4c3ef3e3bd 100644 --- a/src/test/store/__snapshots__/profile-view.test.js.snap +++ b/src/test/store/__snapshots__/profile-view.test.js.snap @@ -431,7 +431,7 @@ Object { "startTime": 0, "symbolicated": true, "toolkit": "", - "version": 27, + "version": 28, }, "pages": Array [ Object { diff --git a/src/test/unit/__snapshots__/profile-conversion.test.js.snap b/src/test/unit/__snapshots__/profile-conversion.test.js.snap index e18f13fced..b279de7581 100644 --- a/src/test/unit/__snapshots__/profile-conversion.test.js.snap +++ b/src/test/unit/__snapshots__/profile-conversion.test.js.snap @@ -479,7 +479,7 @@ Object { "symbolicated": true, "toolkit": undefined, "updateChannel": undefined, - "version": 27, + "version": 28, "visualMetrics": undefined, }, "pages": Array [], @@ -100230,7 +100230,7 @@ Object { "symbolicated": true, "toolkit": undefined, "updateChannel": undefined, - "version": 27, + "version": 28, "visualMetrics": undefined, }, "pages": Array [], @@ -382170,7 +382170,7 @@ Object { "startTime": 0, "symbolicated": true, "toolkit": "", - "version": 27, + "version": 28, }, "pages": Array [], "threads": Array [ @@ -430874,7 +430874,7 @@ Object { "startTime": 0, "symbolicated": true, "toolkit": "", - "version": 27, + "version": 28, }, "pages": Array [], "threads": Array [ @@ -479578,7 +479578,7 @@ Object { "startTime": 0, "symbolicated": true, "toolkit": "", - "version": 27, + "version": 28, }, "pages": Array [], "threads": Array [ @@ -482618,7 +482618,7 @@ Object { "startTime": 0, "symbolicated": true, "toolkit": "", - "version": 27, + "version": 28, }, "pages": Array [], "threads": Array [ @@ -485736,7 +485736,7 @@ Object { "startTime": 0, "symbolicated": true, "toolkit": "", - "version": 27, + "version": 28, }, "pages": Array [], "threads": Array [ @@ -486936,7 +486936,7 @@ Object { "symbolicated": true, "toolkit": undefined, "updateChannel": undefined, - "version": 27, + "version": 28, "visualMetrics": undefined, }, "pages": Array [], @@ -494461,7 +494461,7 @@ Object { "symbolicated": true, "toolkit": undefined, "updateChannel": undefined, - "version": 27, + "version": 28, "visualMetrics": undefined, }, "pages": Array [], @@ -513874,7 +513874,7 @@ Object { "symbolicated": true, "toolkit": undefined, "updateChannel": undefined, - "version": 27, + "version": 28, "visualMetrics": undefined, }, "pages": Array [], @@ -521392,7 +521392,7 @@ Object { "symbolicated": true, "toolkit": undefined, "updateChannel": undefined, - "version": 27, + "version": 28, "visualMetrics": undefined, }, "pages": Array [], @@ -544990,7 +544990,7 @@ Object { "startTime": 0, "symbolicated": true, "toolkit": "", - "version": 27, + "version": 28, }, "pages": Array [], "threads": Array [ diff --git a/src/test/unit/__snapshots__/profile-upgrading.test.js.snap b/src/test/unit/__snapshots__/profile-upgrading.test.js.snap index 886c484ee5..2825c35b54 100644 --- a/src/test/unit/__snapshots__/profile-upgrading.test.js.snap +++ b/src/test/unit/__snapshots__/profile-upgrading.test.js.snap @@ -50,7 +50,7 @@ Object { "symbolicated": true, "toolkit": undefined, "updateChannel": undefined, - "version": 27, + "version": 28, "visualMetrics": undefined, }, "pages": Array [], @@ -7975,7 +7975,7 @@ Object { "stackwalk": 1, "startTime": 1460221352723.438, "toolkit": "cocoa", - "version": 27, + "version": 28, }, "pausedRanges": Array [], "processes": Array [ @@ -9436,7 +9436,7 @@ Object { "stackwalk": 1, "startTime": 1460221352723.438, "toolkit": "cocoa", - "version": 27, + "version": 28, }, "pages": Array [ Object { diff --git a/src/test/unit/marker-schema.test.js b/src/test/unit/marker-schema.test.js index 59e7a70a9c..481a622104 100644 --- a/src/test/unit/marker-schema.test.js +++ b/src/test/unit/marker-schema.test.js @@ -9,7 +9,10 @@ import { markerSchemaFrontEndOnly, } from '../../profile-logic/marker-schema'; import type { MarkerSchema, Marker } from 'firefox-profiler/types'; -import { getDefaultCategories } from '../../profile-logic/data-structures'; +import { + getDefaultCategories, + getEmptyThread, +} from '../../profile-logic/data-structures'; import { storeWithProfile } from '../fixtures/stores'; import { getMarkerSchema } from '../../selectors/profile'; import { getProfileFromTextSamples } from '../fixtures/profiles/processed-profile'; @@ -35,6 +38,7 @@ describe('marker schema labels', function () { function applyLabel(options: LabelOptions): string { const { schemaData, label, payload } = options; const categories = getDefaultCategories(); + const thread = getEmptyThread(); const schema = { name: 'TestDefinedMarker', @@ -50,7 +54,7 @@ describe('marker schema labels', function () { threadId: 1, data: payload, }; - const getter = parseLabel(schema, categories, label); + const getter = parseLabel(schema, categories, thread, label); // There is only one marker, marker 0 return getter(marker); diff --git a/src/types/markers.js b/src/types/markers.js index 230783b20f..fd5d21d8e1 100644 --- a/src/types/markers.js +++ b/src/types/markers.js @@ -27,7 +27,10 @@ export type MarkerFormatType = // sanitized. Please be careful with including other types of PII here as well. // e.g. "Label: Some String" | 'string' - + /// An index into a (currently) thread-local string table, aka UniqueStringArray + /// This is effectively an integer, so wherever we need to display this value, we + /// must first perform a lookup into the appropriate string table. + | 'unique-string' // ---------------------------------------------------- // Numeric types From 47474e1aeb9e026a4465c89d3c0c54bc75b8071f Mon Sep 17 00:00:00 2001 From: Adam Brouwers-Harries Date: Fri, 2 Jun 2023 16:05:59 +0100 Subject: [PATCH 2/3] Make changes based on PR feedback, minor changes to UniqueStringArray API, and add tests for unique-string changes --- src/components/app/MenuButtons/MetaInfo.js | 8 ++- src/profile-logic/gecko-profile-versioning.js | 7 +++ src/profile-logic/marker-schema.js | 39 +++++++------ src/selectors/per-thread/markers.js | 6 +- src/test/unit/marker-schema.test.js | 58 ++++++++++++++++--- src/utils/unique-string-array.js | 12 +++- 6 files changed, 98 insertions(+), 32 deletions(-) diff --git a/src/components/app/MenuButtons/MetaInfo.js b/src/components/app/MenuButtons/MetaInfo.js index 1893b0cdc6..60b42fe02b 100644 --- a/src/components/app/MenuButtons/MetaInfo.js +++ b/src/components/app/MenuButtons/MetaInfo.js @@ -33,6 +33,7 @@ import type { ExtraProfileInfoSection, } from 'firefox-profiler/types'; import type { ConnectedProps } from 'firefox-profiler/utils/connect'; +import { UniqueStringArray } from 'firefox-profiler/utils/unique-string-array'; import './MetaInfo.css'; @@ -148,7 +149,12 @@ class MetaInfoPanelImpl extends React.PureComponent {
{label}
- {formatFromMarkerSchema('moreInfo', format, value)} + {formatFromMarkerSchema( + 'moreInfo', + format, + value, + new UniqueStringArray() + )}
); diff --git a/src/profile-logic/gecko-profile-versioning.js b/src/profile-logic/gecko-profile-versioning.js index 66052ca3f6..f51e02f515 100644 --- a/src/profile-logic/gecko-profile-versioning.js +++ b/src/profile-logic/gecko-profile-versioning.js @@ -1445,6 +1445,13 @@ const _upgraders = { } convertToVersion27Recursive(profile); }, + [28]: (_) => { + // This version bump added a new type for marker schemas, named "unique-string", + // which older frontends will not be able to display. + // No upgrade is needed, as older versions of firefox would not generate + // marker data with unique-string typed data, and no modification is needed in the + // frontend to display older formats. + }, // If you add a new upgrader here, please document the change in // `docs-developer/CHANGELOG-formats.md`. }; diff --git a/src/profile-logic/marker-schema.js b/src/profile-logic/marker-schema.js index 04a61a692b..955172e715 100644 --- a/src/profile-logic/marker-schema.js +++ b/src/profile-logic/marker-schema.js @@ -23,7 +23,6 @@ import type { Marker, MarkerIndex, MarkerPayload, - Thread, } from 'firefox-profiler/types'; import type { UniqueStringArray } from '../utils/unique-string-array'; @@ -144,7 +143,7 @@ export function getSchemaFromMarker( export function parseLabel( markerSchema: MarkerSchema, categories: CategoryList, - thread: Thread, + stringTable: UniqueStringArray, label: string ): (Marker) => string { // Split the label on the "{key}" capture groups. @@ -269,7 +268,7 @@ export function parseLabel( markerSchema.name, format, value, - thread.stringTable + stringTable ) : value; }; @@ -335,7 +334,7 @@ export function getLabelGetter( markerSchemaList: MarkerSchema[], markerSchemaByName: MarkerSchemaByName, categoryList: CategoryList, - thread: Thread, + stringTable: UniqueStringArray, labelKey: LabelKey ): (MarkerIndex) => string { // Build up a list of label functions, that are tied to the schema name. @@ -345,7 +344,7 @@ export function getLabelGetter( if (labelString) { labelFns.set( schema.name, - parseLabel(schema, categoryList, thread, labelString) + parseLabel(schema, categoryList, stringTable, labelString) ); } } @@ -394,7 +393,7 @@ export function formatFromMarkerSchema( markerType: string, format: MarkerFormatType, value: any, - stringTable: ?UniqueStringArray + stringTable: UniqueStringArray ): string { if (value === undefined || value === null) { console.warn( @@ -427,7 +426,12 @@ export function formatFromMarkerSchema( } return row.map((cell, j) => { const { format } = columns[j]; - return formatFromMarkerSchema(markerType, format || 'string', cell); + return formatFromMarkerSchema( + markerType, + format || 'string', + cell, + stringTable + ); }); }); rows.push(...cellRows); @@ -446,13 +450,7 @@ export function formatFromMarkerSchema( // Make sure a non-empty string is returned here. return String(value) || '(empty)'; case 'unique-string': - if (stringTable !== null && stringTable !== undefined) { - return stringTable.getString(value); - } - console.warn( - `Could not find marker table for index "${value}" in markertype "${markerType}"` - ); - return 'Null or undefined string table.'; + return stringTable.getString(value, '(empty)'); case 'duration': case 'time': return formatTimestamp(value); @@ -477,7 +475,9 @@ export function formatFromMarkerSchema( throw new Error('Expected an array for list format'); } return value - .map((v) => formatFromMarkerSchema(markerType, 'string', v)) + .map((v) => + formatFromMarkerSchema(markerType, 'string', v, stringTable) + ) .join(', '); default: console.warn( @@ -501,7 +501,7 @@ export function formatMarkupFromMarkerSchema( markerType: string, format: MarkerFormatType, value: any, - stringTable: ?UniqueStringArray + stringTable: UniqueStringArray ): React.Element | string { if (value === undefined || value === null) { console.warn(`Formatting ${value} for ${JSON.stringify(markerType)}`); @@ -576,7 +576,12 @@ export function formatMarkupFromMarkerSchema(
    {value.map((entry, i) => (
  • - {formatFromMarkerSchema(markerType, 'string', value[i])} + {formatFromMarkerSchema( + markerType, + 'string', + value[i], + stringTable + )}
  • ))}
diff --git a/src/selectors/per-thread/markers.js b/src/selectors/per-thread/markers.js index 9f2ee7f7c7..bb113b217e 100644 --- a/src/selectors/per-thread/markers.js +++ b/src/selectors/per-thread/markers.js @@ -414,7 +414,7 @@ export function getMarkerSelectorsPerThread( ProfileSelectors.getMarkerSchema, ProfileSelectors.getMarkerSchemaByName, ProfileSelectors.getCategories, - threadSelectors.getThread, + threadSelectors.getStringTable, () => 'tooltipLabel', getLabelGetter ); @@ -428,7 +428,7 @@ export function getMarkerSelectorsPerThread( ProfileSelectors.getMarkerSchema, ProfileSelectors.getMarkerSchemaByName, ProfileSelectors.getCategories, - threadSelectors.getThread, + threadSelectors.getStringTable, () => 'tableLabel', getLabelGetter ); @@ -442,7 +442,7 @@ export function getMarkerSelectorsPerThread( ProfileSelectors.getMarkerSchema, ProfileSelectors.getMarkerSchemaByName, ProfileSelectors.getCategories, - threadSelectors.getThread, + threadSelectors.getStringTable, () => 'chartLabel', getLabelGetter ); diff --git a/src/test/unit/marker-schema.test.js b/src/test/unit/marker-schema.test.js index 481a622104..32d9bf078f 100644 --- a/src/test/unit/marker-schema.test.js +++ b/src/test/unit/marker-schema.test.js @@ -9,14 +9,12 @@ import { markerSchemaFrontEndOnly, } from '../../profile-logic/marker-schema'; import type { MarkerSchema, Marker } from 'firefox-profiler/types'; -import { - getDefaultCategories, - getEmptyThread, -} from '../../profile-logic/data-structures'; +import { getDefaultCategories } from '../../profile-logic/data-structures'; import { storeWithProfile } from '../fixtures/stores'; import { getMarkerSchema } from '../../selectors/profile'; import { getProfileFromTextSamples } from '../fixtures/profiles/processed-profile'; import { markerSchemaForTests } from '../fixtures/profiles/marker-schema'; +import { UniqueStringArray } from '../../utils/unique-string-array'; /** * Generally, higher level type of testing is preferred to detailed unit tests of @@ -38,7 +36,10 @@ describe('marker schema labels', function () { function applyLabel(options: LabelOptions): string { const { schemaData, label, payload } = options; const categories = getDefaultCategories(); - const thread = getEmptyThread(); + const stringTable = new UniqueStringArray([ + 'IPC Message', + 'MouseDown Event', + ]); const schema = { name: 'TestDefinedMarker', @@ -54,7 +55,7 @@ describe('marker schema labels', function () { threadId: 1, data: payload, }; - const getter = parseLabel(schema, categories, thread, label); + const getter = parseLabel(schema, categories, stringTable, label); // There is only one marker, marker 0 return getter(marker); @@ -144,6 +145,23 @@ describe('marker schema labels', function () { expect(console.error).toHaveBeenCalledTimes(0); }); + it('can parse labels with unique strings', function () { + expect( + applyLabel({ + label: '{marker.data.message} happened because of {marker.data.event}', + schemaData: [ + { key: 'message', label: 'Message', format: 'unique-string' }, + { key: 'event', label: 'Event', format: 'unique-string' }, + ], + payload: { + message: 0, + event: 1, + }, + }) + ).toEqual('IPC Message happened because of MouseDown Event'); + expect(console.error).toHaveBeenCalledTimes(0); + }); + describe('parseErrors', function () { function testParseError(label: string) { expect( @@ -250,12 +268,24 @@ describe('marker schema formatting', function () { ['percentage', 0.123456789], ['percentage', 1234.56789], ['percentage', 0.000123456], + ['unique-string', 0], + ['unique-string', 1], + ['unique-string', null], + ['unique-string', undefined], + ['unique-string', 42], ]; expect( entries.map( ([format, value]) => - format + ' - ' + formatFromMarkerSchema('none', format, value) + format + + ' - ' + + formatFromMarkerSchema( + 'none', + format, + value, + new UniqueStringArray(['IPC Message', 'MouseDown Event']) + ) ) ).toMatchInlineSnapshot(` Array [ @@ -321,6 +351,11 @@ describe('marker schema formatting', function () { "percentage - 12%", "percentage - 123,457%", "percentage - 0.0%", + "unique-string - IPC Message", + "unique-string - MouseDown Event", + "unique-string - (empty)", + "unique-string - (empty)", + "unique-string - (empty)", ] `); }); @@ -369,8 +404,13 @@ describe('marker schema formatting', function () { entries.map(([format, value]) => [ format, value, - formatMarkupFromMarkerSchema('none', format, value), - formatFromMarkerSchema('none', format, value), + formatMarkupFromMarkerSchema( + 'none', + format, + value, + new UniqueStringArray() + ), + formatFromMarkerSchema('none', format, value, new UniqueStringArray()), ]) ).toMatchSnapshot(); }); diff --git a/src/utils/unique-string-array.js b/src/utils/unique-string-array.js index ebd2a60a69..4597015797 100644 --- a/src/utils/unique-string-array.js +++ b/src/utils/unique-string-array.js @@ -17,13 +17,21 @@ export class UniqueStringArray { } } - getString(index: IndexIntoStringTable): string { - if (!(index in this._array)) { + getString(index: IndexIntoStringTable, els: ?string): string { + if (!this.hasIndex(index)) { + if (els) { + console.warn(`index ${index} not in UniqueStringArray`); + return els; + } throw new Error(`index ${index} not in UniqueStringArray`); } return this._array[index]; } + hasIndex(i: IndexIntoStringTable): boolean { + return i in this._array; + } + hasString(s: string): boolean { return this._stringToIndex.has(s); } From bdba850ab1c0ad89aa938693d1c5adcc914954e0 Mon Sep 17 00:00:00 2001 From: Adam Brouwers-Harries Date: Fri, 16 Jun 2023 14:57:00 +0100 Subject: [PATCH 3/3] Reword profile versioning, and add comments to unique-string tests --- docs-developer/CHANGELOG-formats.md | 2 +- src/profile-logic/gecko-profile-versioning.js | 2 +- src/test/unit/marker-schema.test.js | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs-developer/CHANGELOG-formats.md b/docs-developer/CHANGELOG-formats.md index 82618307db..1a4795902c 100644 --- a/docs-developer/CHANGELOG-formats.md +++ b/docs-developer/CHANGELOG-formats.md @@ -68,7 +68,7 @@ Older versions are not documented in this changelog but can be found in [process ### Version 28 -A new `unique-string` type has been added as part of the marker schema, allowing markers to carry unique-strings in their payloads. +A new `unique-string` marker schema format type has been added, allowing markers to carry unique-strings in their payloads. ### Version 27 diff --git a/src/profile-logic/gecko-profile-versioning.js b/src/profile-logic/gecko-profile-versioning.js index f51e02f515..a267b844bf 100644 --- a/src/profile-logic/gecko-profile-versioning.js +++ b/src/profile-logic/gecko-profile-versioning.js @@ -1446,7 +1446,7 @@ const _upgraders = { convertToVersion27Recursive(profile); }, [28]: (_) => { - // This version bump added a new type for marker schemas, named "unique-string", + // This version bump added a new marker schema format type, named "unique-string", // which older frontends will not be able to display. // No upgrade is needed, as older versions of firefox would not generate // marker data with unique-string typed data, and no modification is needed in the diff --git a/src/test/unit/marker-schema.test.js b/src/test/unit/marker-schema.test.js index 32d9bf078f..47aa263142 100644 --- a/src/test/unit/marker-schema.test.js +++ b/src/test/unit/marker-schema.test.js @@ -268,11 +268,11 @@ describe('marker schema formatting', function () { ['percentage', 0.123456789], ['percentage', 1234.56789], ['percentage', 0.000123456], - ['unique-string', 0], - ['unique-string', 1], - ['unique-string', null], - ['unique-string', undefined], - ['unique-string', 42], + ['unique-string', 0], // Should be "IPC Message", see "stringTable" in "applyLabel" fn + ['unique-string', 1], // Should be "MouseDown Event", see "stringTable" in "applyLabel" fn + ['unique-string', null], // Should be "(empty)" + ['unique-string', undefined], // Should be "(empty)" + ['unique-string', 42], // Should be "(empty)" ]; expect(