sendMetric should have a callback run when the metric is finished sending

RESOLVED FIXED

Status

Snippets
Service
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: mkelly, Assigned: giorgos, Mentored)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
The sendMetric function in the snippet JS currently triggers an async HTTP request and returns, meaning that code run after the function is called could do something that aborts the HTTP request by accident, like changing window.location.

sendMetric should have a callback argument that gets executed once the HTTP request is finished.
(Assignee)

Updated

3 years ago
Assignee: nobody → giorgos
Status: NEW → ASSIGNED
(Assignee)

Comment 1

3 years ago
Fixed! https://github.com/mozilla/snippets-service/commit/c9808df354fe0aa27539f86437ca49d95e8d4cb9
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
(Assignee)

Comment 2

3 years ago
Need to call callback even if we 're not sending the metric.
https://github.com/mozilla/snippets-service/pull/96
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Updated

3 years ago
Status: REOPENED → RESOLVED
Last Resolved: 3 years ago3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.