forked from mozilla-mobile/fenix
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use UpdateUrlAction to record viewTime observations
We discovered that in a tab restore scenario we were recording view time observations that were wrong - we'd record time deltas as-if user was looking at the page while the browser wasn't running. This happens because when we record a viewTime observation, we compare current time with lastAccess time of the tab. In a restore scenario, that lastAccess time happens to be from when the browser was last running - which could be days ago. The simplest solution was to not record a viewTime observation if the url for a tab didn't change during a load event. To achieve this, we needed to change which action we were using as a proxy for "navigation events" - UpdateUrlAction contains the new url, allowing us to compare against the current tab url. Alternative solutions would be to keep using loading actions, but dispatch a lastAccess event before performing a metadata update. This would have worked, but would result in two lastAccess events being dispatched for each navigation event instead of just one.
- Loading branch information
1 parent
b56d8ff
commit b7b8de1
Showing
2 changed files
with
25 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters