Bug 1664252 - Stop breaking redirect chains when expiring visits for long urls. r=adw
authorMarco Bonardo <mbonardo@mozilla.com>
Sat, 12 Sep 2020 01:02:15 +0000
changeset 548423 fbb67f1371852dda8473561e173ab2bfa85ac2ac
parent 548422 872db70a11229fdf8a3ed8c6b750f0be14b99251
child 548424 079bf1a540404e9f8713da616d52f3e302392370
push id37779
push userncsoregi@mozilla.com
push dateSat, 12 Sep 2020 22:03:12 +0000
treeherdermozilla-central@48f10c413965 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1664252
milestone82.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1664252 - Stop breaking redirect chains when expiring visits for long urls. r=adw Differential Revision: https://phabricator.services.mozilla.com/D89924
toolkit/components/places/PlacesExpiration.jsm
--- a/toolkit/components/places/PlacesExpiration.jsm
+++ b/toolkit/components/places/PlacesExpiration.jsm
@@ -143,26 +143,29 @@ const ACTION = {
   IDLE_DAILY: 1 << 4, // happens once a day on idle
   DEBUG: 1 << 5, // happens on TOPIC_DEBUG_START_EXPIRATION
 };
 
 // The queries we use to expire.
 const EXPIRATION_QUERIES = {
   // Some visits can be expired more often than others, cause they are less
   // useful to the user and can pollute awesomebar results:
-  // 1. urls over 255 chars
-  // 2. redirect sources and downloads
+  // 1. visits to urls over 255 chars
+  // 2. downloads
+  // We never expire redirect targets, because they are currently necessary to
+  // recognize redirect sources (see Bug 468710 for better options).
   // Note: due to the REPLACE option, this should be executed before
   // QUERY_FIND_VISITS_TO_EXPIRE, that has a more complete result.
   QUERY_FIND_EXOTIC_VISITS_TO_EXPIRE: {
     sql: `INSERT INTO expiration_notify (v_id, url, guid, visit_date, reason)
           SELECT v.id, h.url, h.guid, v.visit_date, "exotic"
           FROM moz_historyvisits v
           JOIN moz_places h ON h.id = v.place_id
           WHERE visit_date < strftime('%s','now','localtime','start of day','-60 days','utc') * 1000000
+          AND visit_type NOT IN (5,6)
           AND ( LENGTH(h.url) > 255 OR v.visit_type = 7 )
           ORDER BY v.visit_date ASC
           LIMIT :limit_visits`,
     actions:
       ACTION.TIMED_OVERLIMIT |
       ACTION.IDLE_DIRTY |
       ACTION.IDLE_DAILY |
       ACTION.DEBUG,