Open Bug 1616103 Opened 6 years ago Updated 3 years ago

Bookmarks search - unsorted results order

Categories

(Firefox :: Bookmarks & History, defect, P3)

73 Branch
Desktop
Unspecified
defect

Tracking

()

People

(Reporter: msvc, Unassigned)

Details

Reproduce: Use the Bookmarks Manager and a SQLite-browser to perform a search in the 'moz_bookmarks'-table that gives more than seven results/matched entries. The results will be initially sorted according to their ID number (rowid), but in the Bookmarks Manager the first and last matches/entries are swapped.

Unsorted bookmarks search:
-sorted by ID number in places.sqlite (moz_bookmarks)
-first and last matches/entries are swapped (with more than 7 results)
-correct order only remains with less than 7 results

While it could make sense to show the most recent/last created entry at top, the first/oldest one shouldn't be placed at the very bottom.

(In reply to msvc from comment #0)

Reproduce: Use the Bookmarks Manager and a SQLite-browser to perform a search in the 'moz_bookmarks'-table that gives more than seven results/matched entries. The results will be initially sorted according to their ID number (rowid), but in the Bookmarks Manager the first and last matches/entries are swapped.

Unsorted bookmarks search:
-sorted by ID number in places.sqlite (moz_bookmarks)

The default order of bookmarks as displayed on the bookmarks manager is governed by position, not the id. If you apply that, does it resolve your issue?

Flags: needinfo?(msvc)

ids in databases are not a stable way to sort things, and should not be used, anyway

The sorting within the default/custom folders of the bookmarks manager is not the issue, it's merely the list/view of matched bookmarks that's displayed when using the top-right 'Search Bookmarks' field.

Flags: needinfo?(msvc)

Oh, it's about sorting of search results in the Library or the bookmarks sidebar.
I can reproduce the problem, I ran:

SELECT * FROM moz_bookmarks b
JOIN moz_places h ON b.fk = h.id
WHERE b.title LIKE "%forums%" OR h.url LIKE "%forums%"
ORDER BY b.id ASC

and I looked for "forums" in the Library as well.
In this case results are SORT_BY_NONE, it's very strange that first and last items are swapped, we do a plain ORDER BY id ASC

We should investigate why this happens, since it may hide other subtle bugs
And off-hand, it may be more useful to sort search results by dateAdded DESC...

Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.