diff --git a/src/shared/plugins/approval/plugin-consent-fingerprint.ts b/src/shared/plugins/approval/plugin-consent-fingerprint.ts index 497bf8ed861..300ab62ec88 100644 --- a/src/shared/plugins/approval/plugin-consent-fingerprint.ts +++ b/src/shared/plugins/approval/plugin-consent-fingerprint.ts @@ -76,7 +76,8 @@ function replacementIdentity(manifest: PluginConsentSubject): string { .flatMap((command) => isPluginJsonObject(command) && typeof command.replaces === 'string' ? [command.replaces] : [] ) - .toSorted() + // flatMap already copied; the phone's Hermes engine lacks toSorted. + .sort() return actions.length > 0 ? `\0replaces:${actions.join(',')}` : '' } diff --git a/src/shared/plugins/contributions/plugin-command-replaces.test.ts b/src/shared/plugins/contributions/plugin-command-replaces.test.ts index d19875cc9e2..97b55d8c8dc 100644 --- a/src/shared/plugins/contributions/plugin-command-replaces.test.ts +++ b/src/shared/plugins/contributions/plugin-command-replaces.test.ts @@ -102,5 +102,8 @@ describe('consent for a replacement', () => { const replacing = fingerprint([{ id: 'tasks', title: 'Tasks', replaces: 'view.tasks' }]) expect(replacing).not.toBe(plain) expect(fingerprint([{ id: 'other', title: 'Other' }])).toBe(plain) + const tasks = { id: 'tasks', title: 'Tasks', replaces: 'view.tasks' } + const ports = { id: 'ports', title: 'Ports', replaces: 'sidebar.ports.toggle' } + expect(fingerprint([ports, tasks])).toBe(fingerprint([tasks, ports])) }) })