Closed Bug 388695 Opened 17 years ago Closed 17 years ago

getBookmarkIdsForURI should sort by relevance

Categories

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

defect

Tracking

()

RESOLVED FIXED
Firefox 3 alpha7

People

(Reporter: asaf, Assigned: asaf)

References

Details

Attachments

(1 file, 3 obsolete files)

Attached patch patch (obsolete) — Splinter Review
getBookmarkIdsForURI should sort by relevance. For the time being, this means sorting by last-modified or date-added (descending)
Attachment #272873 - Flags: review?(dietrich)
Blocks: 385266
Priority: -- → P2
Attachment #272873 - Attachment is patch: true
Attachment #272873 - Attachment mime type: application/octet-stream → text/plain
Attachment #272873 - Flags: review?(dietrich) → review+
you could do something like this: select id, max(recent) from (select id, lastModified as recent from moz_bookmarks UNION select id, dateAdded as recent from moz_bookmarks order by 2 DESC)
Attached patch patch (obsolete) — Splinter Review
you'd think sql maps NULL to 0 when comparing, you'd.
Attachment #272873 - Attachment is obsolete: true
Attachment #272891 - Flags: review?(dietrich)
Attachment #272891 - Flags: review?(dietrich) → review+
mozilla/toolkit/components/places/src/nsNavBookmarks.cpp 1.110 mozilla/toolkit/components/places/tests/bookmarks/test_bookmarks.js 1.31 mozilla/toolkit/components/places/tests/unit/test_tagging.js 1.2
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Attached patch tests fix (checked in) (obsolete) — Splinter Review
backed-out, these tinderboxes still know nothing about date & time.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
imho if you need only to get ids you could put the max into order by clause: SELECT b.id FROM moz_bookmarks b JOIN moz_places p ON b.fk = p.id WHERE p.url = ?1 AND b.type = ?2 ORDER BY MAX(COALESCE(b.lastModified, 0), b.dateAdded) DESC this should have less memory usage on results
Attached patch patch v2Splinter Review
* comment 6 * timeout-based tests for this method, so it passes on the VMs. * use sort() otherwise in tests * making getTagsForURI return a sorted list
Attachment #272891 - Attachment is obsolete: true
Attachment #272902 - Attachment is obsolete: true
Attachment #273340 - Flags: review?(sayrer)
Status: REOPENED → ASSIGNED
Attachment #273340 - Flags: review?(sayrer) → review+
mozilla/browser/components/places/tests/unit/test_placesTxn.js 1.4 mozilla/toolkit/components/places/public/nsITaggingService.idl 1.2 mozilla/toolkit/components/places/src/nsNavBookmarks.cpp 1.112 mozilla/toolkit/components/places/src/nsTaggingService.js 1.2 mozilla/toolkit/components/places/tests/bookmarks/test_388695.js initial revision: 1.1 mozilla/toolkit/components/places/tests/bookmarks/test_bookmarks.js 1.34
Status: ASSIGNED → RESOLVED
Closed: 17 years ago17 years ago
Flags: in-testsuite+
Flags: blocking1.8.1.6?
Resolution: --- → FIXED
Flags: blocking1.8.1.6?
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h". In Thunderbird 3.0b, you do that as follows: Tools | Message Filters Make sure the correct account is selected. Click "New" Conditions: Body contains places-to-b-and-h Change the action to "Delete Message". Select "Manually Run" from the dropdown at the top. Click OK. Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter. Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: