Bug 1293710 - Group activity stream highlights by URL to avoid duplicates. r=ahunt
authorSebastian Kaspari <s.kaspari@gmail.com>
Fri, 02 Sep 2016 19:52:56 +0200
changeset 312670 e7a3dc48a79941fcd48f1c48dcdf79227a569299
parent 312669 8bd1bb9a4fd019646ff40f596f63afde00d7d04f
child 312671 20809b09b2ff1db2dcac29f6e0e2e3ece13a294e
push id30652
push userphilringnalda@gmail.com
push dateMon, 05 Sep 2016 20:05:11 +0000
treeherdermozilla-central@91a0bc34de8a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahunt
bugs1293710
milestone51.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 1293710 - Group activity stream highlights by URL to avoid duplicates. r=ahunt The same URL could be picked as highlight from history and from bookmarks. MozReview-Commit-ID: 5vBHluZKfAN
mobile/android/base/java/org/mozilla/gecko/db/BrowserProvider.java
--- a/mobile/android/base/java/org/mozilla/gecko/db/BrowserProvider.java
+++ b/mobile/android/base/java/org/mozilla/gecko/db/BrowserProvider.java
@@ -1193,17 +1193,20 @@ public class BrowserProvider extends Sha
                 "AND " + History.TITLE + " NOT NULL AND " + History.TITLE + " != '' " +
                 "AND " + History.IS_DELETED + " = 0 " +
                 // TODO: Implement block list (bug 1298783)
                 // TODO: Implement domain black list (bug 1298786)
                 // TODO: Group by host (bug 1298785)
                 "ORDER BY " + History.DATE_LAST_VISITED + " DESC " +
                 "LIMIT " + historyLimit + ")";
 
-        final String query = "SELECT DISTINCT * FROM (" + bookmarksQuery + " UNION ALL " + historyQuery + ");";
+        final String query = "SELECT DISTINCT * " +
+                "FROM (" + bookmarksQuery + " " +
+                "UNION ALL " + historyQuery + ") " +
+                "GROUP BY " + Combined.URL + ";";
 
         return db.rawQuery(query, null);
     }
 
     @Override
     public Cursor query(Uri uri, String[] projection, String selection,
             String[] selectionArgs, String sortOrder) {
         final int match = URI_MATCHER.match(uri);