-
Notifications
You must be signed in to change notification settings - Fork 971
Add a session migration for uphold fingerprinting #14178
Conversation
let migrationNeeded = false | ||
|
||
try { | ||
migrationNeeded = compareVersions(data.lastAppVersion, '0.22.714') !== 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compareVersions will return -1 if less than 0.22.714
and 0 for 0.22.714
. It can only be 1 if greater than 0.22.714
(and in that case, the migration won't run)
@bsclifton doesn't #14158 already fix the issue for most users? is this PR just so that users who set some non-default value for FP get set to allowAllFingerprinting? i'm not sure the latter is desirable |
|
I re-reviewed the code- the default site import only runs once actually: browser-laptop/app/sessionStore.js Lines 968 to 979 in ea409ce
@diracdeltas this code is needed... but we shouldn't overwrite the setting if it exists. Let me tweak the code a bit |
Fixes #14152 Lays down foundation for #10488 Auditors: @diracdeltas, @darkdh
Code updated! Will only set a value if one isn't set... but will run once for any existing users upgrading from 0.22.714 (or earlier) |
data.siteSettings[pattern] = {} | ||
} | ||
let targetSetting = data.siteSettings[pattern] | ||
if (targetSetting.fingerprintingProtection == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noting that this will still override the siteSetting if the global setting is set to 'blockAllFingerprinting'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with 321b208 😄 👍
New commit added fixing #14204 - I forgot to include |
app/migrations/20180518_uphold.js
Outdated
// don't apply if: | ||
// - user chooses to block all fingerprinting (global setting) | ||
// - user is not upgrading from 0.22.714 or earlier | ||
if (data.fingerprintingProtectionAll || !data.lastAppVersion) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you want to check data.fingerprintingProtectionAll && data.fingerprintingProtectionAll.enabled
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After missing this, I fixed this and added some unit tests! 😄 Should cover most of the cases
… place Fixes #14204 Auditors: @diracdeltas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm thanks!
Add a session migration for uphold fingerprinting
Add a session migration for uphold fingerprinting
Fixes #14152
Fixes #14204
Lays down foundation for #10488
Auditors: @diracdeltas, @darkdh
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist:
Tests