FrancescoSTL / Site-Sonar

A browser extension which silently crowd-sources ad performance as you browse. Let's put an end to bad ads.
http://site-sonar.com
Mozilla Public License 2.0
9 stars 2 forks source link

Data not sending after X minutes in browser #43

Closed FrancescoSTL closed 7 years ago

FrancescoSTL commented 7 years ago

Seems as though the timers we've set up don't persist between sessions as, when I leave my computer and it locks, the add-on stops posting data to the server and I have to reinstall the add-on. This can still needs to be verified.

FrancescoSTL commented 7 years ago

I'm not still certain that timer persistence is the issue. If WebExtensions run in the same way that the add-on sdk does, it seems that startListeners() should be run on startup everytime Firefox is opened.

The situation in which this has happened to me is when my laptop falls asleep and then I come back to use Firefox, at which point, the add-on quits logging data. Still need to investigate more.

FrancescoSTL commented 7 years ago

Happened once again today.

FrancescoSTL commented 7 years ago

I've discovered the issue and changed the title accordingly

screen shot 2016-08-13 at 4 37 45 pm
FrancescoSTL commented 7 years ago

Looks like the maximum file size for documents to MongoDB is 16mb, so we'll limit our POST to 15mb or so. This is an issue with the API, so I'll fix on the dashboard repo.

http://stackoverflow.com/questions/15627573/nodejs-express-request-entity-too-large-heroku

FrancescoSTL commented 7 years ago

The dashboard is now updated so that it accepts data up to 15mb. We should probably be checking client-side to make sure the string isn't larger than that, because if it is, users will have a growing Map which could increase in size indefinitely. While the likelyhood a user gets 15mb worth of asset logs in 2 min is astronomically low (that would require loading >36,000 ad-asset records), we should probably make sure it isn't happening.

I'll delete this and log a new issue.