1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-25 03:20:23 +01:00

Fix missing property on snap export metric (#20685)

This commit is contained in:
Frederik Bolding 2023-09-01 13:10:42 +02:00 committed by GitHub
parent 32c4559349
commit acf386c609
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1855,14 +1855,16 @@ export default class MetamaskController extends EventEmitter {
/** /**
* Tracks snaps export usage. Note: This function is throttled to 1 call per 60 seconds. * Tracks snaps export usage. Note: This function is throttled to 1 call per 60 seconds.
* *
* @param {string} snapId - The ID of the snap the handler is being triggered on.
* @param {string} handler - The handler to trigger on the snap for the request. * @param {string} handler - The handler to trigger on the snap for the request.
*/ */
_trackSnapExportUsage = throttle( _trackSnapExportUsage = throttle(
(handler) => (snapId, handler) =>
this.metaMetricsController.trackEvent({ this.metaMetricsController.trackEvent({
event: MetaMetricsEventName.SnapExportUsed, event: MetaMetricsEventName.SnapExportUsed,
category: MetaMetricsEventCategory.Snaps, category: MetaMetricsEventCategory.Snaps,
properties: { properties: {
snap_id: snapId,
export: handler, export: handler,
}, },
}), }),
@ -1880,7 +1882,7 @@ export default class MetamaskController extends EventEmitter {
* @returns The result of the JSON-RPC request. * @returns The result of the JSON-RPC request.
*/ */
handleSnapRequest(args) { handleSnapRequest(args) {
this._trackSnapExportUsage(args.handler); this._trackSnapExportUsage(args.snapId, args.handler);
return this.controllerMessenger.call('SnapController:handleRequest', args); return this.controllerMessenger.call('SnapController:handleRequest', args);
} }