mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
fix issue with fragment messageIds (#17949)
This commit is contained in:
parent
8472ccb7b0
commit
d9826e9385
@ -356,7 +356,14 @@ export default class MetaMetricsController {
|
||||
currency: fragment.currency,
|
||||
environmentType: fragment.environmentType,
|
||||
actionId: fragment.actionId,
|
||||
uniqueIdentifier: fragment.uniqueIdentifier,
|
||||
// We append success or failure to the unique-identifier so that the
|
||||
// messageId can still be idempotent, but so that it differs from the
|
||||
// initial event fired. The initial event was preventing new events from
|
||||
// making it to mixpanel because they were using the same unique ID as
|
||||
// the events processed in other parts of the fragment lifecycle.
|
||||
uniqueIdentifier: fragment.uniqueIdentifier
|
||||
? `${fragment.uniqueIdentifier}-${abandoned ? 'failure' : 'success'}`
|
||||
: undefined,
|
||||
});
|
||||
const { fragments } = this.store.getState();
|
||||
delete fragments[id];
|
||||
|
@ -119,6 +119,7 @@ const SAMPLE_NON_PERSISTED_EVENT = {
|
||||
category: 'Unit Test',
|
||||
successEvent: 'sample non-persisted event success',
|
||||
failureEvent: 'sample non-persisted event failure',
|
||||
uniqueIdentifier: 'sample-non-persisted-event',
|
||||
properties: {
|
||||
test: true,
|
||||
},
|
||||
@ -175,7 +176,7 @@ describe('MetaMetricsController', function () {
|
||||
...DEFAULT_EVENT_PROPERTIES,
|
||||
test: true,
|
||||
},
|
||||
messageId: Utils.generateRandomId(),
|
||||
messageId: 'sample-non-persisted-event-failure',
|
||||
timestamp: new Date(),
|
||||
});
|
||||
const metaMetricsController = getMetaMetricsController();
|
||||
|
Loading…
Reference in New Issue
Block a user