 Issue 6013081427640320:
  Issue 537 - Mark first few downloads  (Closed)
    
  
    Issue 6013081427640320:
  Issue 537 - Mark first few downloads  (Closed) 
  | Index: lib/downloader.js | 
| =================================================================== | 
| --- a/lib/downloader.js | 
| +++ b/lib/downloader.js | 
| @@ -197,7 +197,8 @@ | 
| "&applicationVersion=" + encodeURIComponent(applicationVersion) + | 
| "&platform=" + encodeURIComponent(platform) + | 
| "&platformVersion=" + encodeURIComponent(platformVersion) + | 
| - "&lastVersion=" + encodeURIComponent(downloadable.lastVersion); | 
| + "&lastVersion=" + encodeURIComponent(downloadable.lastVersion) + | 
| + "&downloadCount=" + encodeURIComponent(downloadable.downloadCount); | 
| return url; | 
| }, | 
| @@ -291,6 +292,10 @@ | 
| return; | 
| } | 
| + // We limit the download count to 5+ to keep the request anonymized | 
| + if (!isNaN(downloadable.downloadCount) && ++downloadable.downloadCount > 5) | 
| + downloadable.downloadCount = "5+"; | 
| 
Wladimir Palant
2014/11/10 19:18:15
Storing numbers and strings in the same variable s
 
Thomas Greiner
2014/11/11 11:54:46
What I wanted to avoid is (a) stopping the counter
 
Wladimir Palant
2014/11/11 16:07:00
Yes, I was also considering whether (b) is a probl
 
Thomas Greiner
2014/11/11 17:17:18
Done.
 | 
| + | 
| this.onDownloadSuccess(downloadable, request.responseText, errorCallback, function redirectCallback(url) | 
| { | 
| if (redirects >= this.maxRedirects) | 
| @@ -378,4 +383,10 @@ | 
| * @type Integer | 
| */ | 
| hardExpiration: 0, | 
| + | 
| + /** | 
| + * Number indicating how often the object was downloaded. | 
| + * @type Integer | 
| + */ | 
| + downloadCount: 1, | 
| 
Thomas Greiner
2014/11/10 18:14:55
This number is always one higher than the number o
 
Wladimir Palant
2014/11/10 19:18:15
Incrementing after success seems ok, but why not s
 
Thomas Greiner
2014/11/11 11:54:46
If this is set to 0 then the number we send is 0-b
 
Wladimir Palant
2014/11/11 16:07:00
I don't think we actually agreed on the exact mean
 
Thomas Greiner
2014/11/11 17:17:18
Done.
 | 
| }; |