Skip to content
Snippets Groups Projects
Commit f08f9c72 authored by Austin King's avatar Austin King
Browse files

Merge pull request #1587 from mozilla/issue1567

when the server returns a 413 error for posting of interaction data, cle...
parents 5850533a 7ab4969d
No related branches found
No related tags found
No related merge requests found
......@@ -96,10 +96,21 @@ BrowserID.Modules.InteractionData = (function() {
function publishStored(oncomplete) {
var data = storage.get();
// XXX: should we even try to post data if it's larger than some reasonable
// threshold?
if (data && data.length !== 0) {
network.sendInteractionData(data, function() {
storage.clear();
complete(oncomplete, true);
}, function(status) {
// if the server returns a 413 error, (too much data posted), then
// let's clear our local storage and move on. This does mean we
// loose some interaction data, but it shouldn't be statistically
// significant.
if (status && status.network && status.network.status === 413) {
storage.clear();
}
complete(oncomplete, false);
});
}
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment