Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gh 1763/metrics feature/new triggers for broken page pings #418

Merged
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
4ecd3d0
Update broken ping reload threshhold to 60 seconds
wlycdgr Jul 17, 2019
9c74083
Merge branch 'develop' into GH-1763/metrics-feature/new-triggers-for-…
wlycdgr Jul 19, 2019
1ed578e
Add startPossibleBrokenPageTimer method to Metrics, implement the del…
wlycdgr Jul 22, 2019
99305fc
Implement metrics broken page trigger handler that uses existing even…
wlycdgr Jul 22, 2019
52e9a7a
Add setup_pth and setup_block parameters to broken_page ping
wlycdgr Jul 22, 2019
311b498
Clear and reset broken page watcher setTimeout handler if a new trigg…
wlycdgr Jul 22, 2019
dd1d215
Add pause Ghostery trigger for Metrics broken page watcher
wlycdgr Jul 22, 2019
49281a8
Add local tracker unblock trigger for Metrics broken page watcher.
wlycdgr Jul 22, 2019
5e5d996
Handle new tab creation for broken page watcher. Add documentation co…
wlycdgr Jul 23, 2019
f2c49ab
Remove broken page metrics ping call from TabInfo#create
wlycdgr Jul 23, 2019
0664aa5
Revert smart unblock threshold to 30 seconds. Add comments explaining…
wlycdgr Jul 23, 2019
28da0df
Trigger metrics broken page watcher on individual tracker site specif…
wlycdgr Jul 23, 2019
e7cd1bc
Pacify linter
wlycdgr Jul 23, 2019
e0076c1
Only set broken page watcher on whitelist add, not both add and remove
wlycdgr Jul 23, 2019
b9cf1ee
Change this.BROKEN_APGE_NEW_TAB value to a less mysterious 5. RIP Age…
wlycdgr Jul 23, 2019
81aa786
Merge branch 'develop' into GH-1763/metrics-feature/new-triggers-for-…
jsignanini Jul 24, 2019
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Revert smart unblock threshold to 30 seconds. Add comments explaining…

… that the difference for thresholds for metrics and smart block is intentional.
  • Loading branch information
wlycdgr committed Jul 23, 2019
commit 0664aa54c7043216ef3670307f8e8a51c4c6513d
@@ -30,7 +30,12 @@ const FIRST_REWARD_METRICS = ['rewards_first_accept', 'rewards_first_reject', 'r
const { METRICS_SUB_DOMAIN, EXTENSION_VERSION, BROWSER_INFO } = globals;
const IS_EDGE = (BROWSER_INFO.name === 'edge');
const MAX_DELAYED_PINGS = 100;
const BROKEN_PAGE_WATCH_THRESHOLD = 60000; // 60 seconds

// Note that this threshold is intentionally different from the 30 second threshold in PolicySmartBlock,
// which is used to set the reloaded property on tab objects and to activate smart unblock behavior
// see GH-1797 for more details
const BROKEN_PAGE_METRICS_THRESHOLD = 60000; // 60 seconds

/**
* Class for handling telemetry pings.
* @memberOf BackgroundClasses
@@ -156,7 +161,7 @@ class Metrics {
on: true,
triggerId,
triggerTime: Date.now(),
timeoutId: setTimeout(this._clearBrokenPageWatcher, BROKEN_PAGE_WATCH_THRESHOLD),
timeoutId: setTimeout(this._clearBrokenPageWatcher, BROKEN_PAGE_METRICS_THRESHOLD),
url: tabUrl,
});
});
@@ -251,11 +251,13 @@ class PolicySmartBlock {
checkReloadThreshold(tabId) {
if (!this.shouldCheck(tabId)) { return false; }

const THRESHHOLD = 60000; // 60 seconds
// Note that this threshold is different from the broken page ping threshold in Metrics, which is 60 seconds
// see GH-1797 for more details
const SMART_BLOCK_BEHAVIOR_THRESHOLD = 30000; // 30 seconds

return (
tabInfo.getTabInfoPersist(tabId, 'numOfReloads') > 1 &&
((Date.now() - tabInfo.getTabInfoPersist(tabId, 'firstLoadTimestamp')) < THRESHHOLD) || false
((Date.now() - tabInfo.getTabInfoPersist(tabId, 'firstLoadTimestamp')) < SMART_BLOCK_BEHAVIOR_THRESHOLD) || false
);
}

@@ -69,7 +69,7 @@ class TabInfo {
},
insecureRedirects: [],
};

this._tabInfo[tab_id] = info;
this._updateUrl(tab_id, tab_url);
}
ProTip! Use n and p to navigate between commits in a pull request.