Closed Bug 1124471 Opened 9 years ago Closed 9 years ago

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

Categories

(Snippets :: Service, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: osmose, Assigned: giorgos, Mentored)

Details

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: nobody → giorgos
Status: NEW → ASSIGNED
Fixed! https://github.com/mozilla/snippets-service/commit/c9808df354fe0aa27539f86437ca49d95e8d4cb9
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
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 → ---
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.