Closed Bug 385829 Opened 19 years ago Closed 18 years ago

Search for bookmark queries by lastModified / dateDated

Categories

(Firefox :: Bookmarks & History, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 3 alpha7

People

(Reporter: asaf, Assigned: moco)

Details

Attachments

(2 files, 5 obsolete files)

For the recently used tags query, we need support for something like place:folder=[TAG_ROOT]&sort=[LAST_MODIFIED]&maxResults=10
Blocks: 385831
Assignee: nobody → sspitzer
Flags: blocking-firefox3?
Target Milestone: --- → Firefox 3 beta1
accepting. will start on this ASAP so that I can unblock Mano's other bugs.
Status: NEW → ASSIGNED
Attached patch patch, v1 (obsolete) — Splinter Review
still need: example urls: // toolbar folder (for me) last modified descending place:folder=6&queryType=1&sort=14&maxResults=5 // toolbar folder (for me) last modified ascending place:folder=6&queryType=1&sort=13&maxResults=5 1) unit tests 2) check that when changes are made to the modification date, changes are observed
Attached patch patch, v2 (obsolete) — Splinter Review
determine the proper update requirements for this type of query. in the past, we have assumed that if you define the max results, it must be a history query, but that is no longer the case.
Attachment #272352 - Attachment is obsolete: true
Attached patch patch, v3 (obsolete) — Splinter Review
add support for sorting by date added as well
Attachment #272353 - Attachment is obsolete: true
with that you can do an interesting query like: place:queryType=1&sort=12&maxResults=8&onlyBookmarked=1 "show me the top 8 bookmarks sorted by date added descending" I'll go write some unit tests and then seek review.
Attached patch unit tests (obsolete) — Splinter Review
Attachment #272364 - Flags: review?(mano)
Seth: wrong bug or wrong patch?
> Seth: wrong bug or wrong patch? Actually, an incomplete patch. I misunderstood the problem. tags are folders (under the tag root, for example, folder=3), and a tagged uri is a bookmark under that folder. I'll continue working on what you want, which is support for a query that results in the child folders of a folder, sorted by last modified. I still think we want these changes, though. Can you review them?
Comment on attachment 272354 [details] [diff] [review] patch, v3 >Index: toolkit/components/places/src/nsNavHistory.cpp >=================================================================== >+ NS_WARNING("SORT_BY_DATEADDED_DESCENDING only makes sense for bookmark queries"); >+ return NS_ERROR_UNEXPECTED; >+ } >+ break; I think we better ignore the it here and not throw, the post-query sorting methods have their fallbacks for cases like this. r=mano otherwise.
Attachment #272354 - Flags: review?(mano) → review+
Comment on attachment 272364 [details] [diff] [review] unit tests Seth, any chance you can move this test to a separate file (test_bugXXX etc.)? This one is getting overloaded.
> I think we better ignore the it here and not throw, the post-query sorting > methods have their fallbacks for cases like this. I don't think the post-query sorting methods will handle it. What are you thinking of? I think we'll just proceed silently, and not sort at all.
Attached patch break out unit test, per mano (obsolete) — Splinter Review
Attachment #272364 - Attachment is obsolete: true
Attachment #272575 - Flags: review?(mano)
Attachment #272364 - Flags: review?(mano)
morphing. logged bug #388378 about what Mano needs for tagging.
No longer blocks: 385826, 385831
Summary: Search For Folders support → Search for bookmark queries by lastModified / dateDated
Attachment #272354 - Attachment is obsolete: true
Attachment #272576 - Flags: review+
fixed. Checking in nsNavHistory.cpp; /cvsroot/mozilla/toolkit/components/places/src/nsNavHistory.cpp,v <-- nsNavHis tory.cpp new revision: 1.143; previous revision: 1.142 done awaiting review from mano before I check in the unit, so marking in-testsuite?
Flags: in-testsuite?
Comment on attachment 272575 [details] [diff] [review] break out unit test, per mano >Index: test_385829.js >=================================================================== >+// get bookmarks root index >+var root = bmsvc.bookmarksRoot; id, not index. >+// main >+function run_test() { >+ // test search on folder with various sorts and max results >+ // see bug #385829 >+ try { please remove the surrounding try block. >+ var bug385829folder >+ = bmsvc.createFolder(root, "bug 385829 test", bmsvc.DEFAULT_INDEX); you can use a shorter name now. >+ var options = histsvc.getNewQueryOptions(); >+ var query = histsvc.getNewQuery(); >+ options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS; >+ options.maxResults = 3; >+ query.onlyBookmarked = true; onlyBookmarked is meaningless for QUERY_TYPE_BOOKMARKS >+ // test SORT_BY_DATEADDED_ASCENDING >+ options.sortingMode = options.SORT_BY_DATEADDED_ASCENDING; >+ var result = histsvc.executeQuery(query, options); >+ var rootNode = result.root; >+ rootNode.containerOpen = true; >+ var cc = rootNode.childCount; >+ do_check_true(cc == 3); nit: do_check_eq(cc, 3) >+ rootNode.containerOpen = false; >+ // test SORT_BY_... >+ options.sortingMode = options.SORT_BY_...; >+ result = histsvc.executeQuery(query, options); >+ rootNode = result.root; >+ rootNode.containerOpen = true; hrm, i would rather set the new sortingMode on the result directly so we also test live update.
Attachment #272575 - Flags: review?(mano) → review-
Attachment #272575 - Attachment is obsolete: true
Attachment #273027 - Flags: review?(mano)
the fix landed on 7/16, so marking fixed. but the unit test is still pending review.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Comment on attachment 273027 [details] [diff] [review] unit tests v2, per mano r=mano
Attachment #273027 - Flags: review?(mano) → review+
unit tests checked in: cvs commit: Examining . RCS file: /cvsroot/mozilla/toolkit/components/places/tests/bookmarks/test_385829 .js,v done Checking in test_385829.js; /cvsroot/mozilla/toolkit/components/places/tests/bookmarks/test_385829.js,v <-- test_385829.js initial revision: 1.1 done Checking in test_bookmarks.js; /cvsroot/mozilla/toolkit/components/places/tests/bookmarks/test_bookmarks.js,v <-- test_bookmarks.js new revision: 1.33; previous revision: 1.32 done
Flags: in-testsuite? → in-testsuite+
Flags: blocking-firefox3? → blocking-firefox3+
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: