The firstVersion parameter is not properly truncated for older dates
Background
We send the firstVersion
and lastVersion
GET parameters when requesting the notifications.json
file. Their values are the first and last recorded versions of notifications.json which we have fetched. To protect the user's privacy, we truncate the firstVersion
parameter if it is more than 30 days ago. Unfortunately there seems to be a bug, causing that truncation not to occur. Our data team is reporting incorrect values for the firstVersion
parameter.
Environment
Adblock Plus for Chrome, Firefox and Opera version 3.6.
For example, given a lastVersion
is 20190916
and firstVersion
is 20190807
.
Observed behavior
The value of the firstVersion
parameter sent is 20190807
.
Expected behavior
The value of the firstVersion
parameter should be 201908
.
Additional information
- See issue 7168 and d946caae (!60 (closed))
- The cause of this problem is that we accidentally use the bitwise OR (
|
) operator instead of the logical one (||
). Specifically, inlib/notification.js
we do this:
let minutes = version.substring(10, 12) | "00";
- This bug was included in the following releases:
- Adblock Plus for Chrome, Firefox and Opera
3.6.3
,3.6.2
,3.6.1
and3.6
. - Adblock Plus for Edge:
0.9.17
and0.9.16
.
- Adblock Plus for Chrome, Firefox and Opera
Integration notes
None.
Hints for testers
Repeat the tests for issue 7168.
Edited by Manish Jethani