Closed
Bug 879698
Opened 11 years ago
Closed 6 years ago
[Contacts API] Allow 'higherThan' and 'lowerThan' options in nsIContactFindOptions.filterOps
Categories
(Core Graveyard :: DOM: Contacts, defect, P4)
Core Graveyard
DOM: Contacts
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: ferjm, Unassigned)
References
Details
(Keywords: perf, Whiteboard: [c= p= s= u=])
Attachments
(1 file, 1 obsolete file)
13.32 KB,
patch
|
gwagner
:
review+
|
Details | Diff | Splinter Review |
After bug 864556 landed, a valid use case for this would be an application locally storing the nsIDOMContact.updated value in its cache and getting the oldest value as soon as its cache revision differs from the Contacts API DB one. In that case, the app could request the list of contacts updated after that date and refresh its cache according to the query result. This way we would avoid forcing the app to get the whole list of contacts.
Reporter | ||
Updated•11 years ago
|
Assignee: nobody → ferjmoreno
Reporter | ||
Comment 1•11 years ago
|
||
Blocks bug 862385 which is leo+, so leo?
Blocks: 862385
blocking-b2g: --- → leo?
Reporter | ||
Comment 2•11 years ago
|
||
I'd like to write a few more tests before asking for review, but I could use some feedback in the meantime :)
Attachment #758615 -
Flags: feedback?(anygregor)
Reporter | ||
Updated•11 years ago
|
Attachment #758615 -
Attachment is patch: true
Attachment #758615 -
Attachment mime type: text/x-patch → text/plain
Comment 3•11 years ago
|
||
Comment on attachment 758615 [details] [diff] [review] wip Review of attachment 758615 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/contacts/fallback/ContactDB.jsm @@ +362,5 @@ > + objectStore.createIndex("birthday", "properties.bday", { > + multiEntry: true > + }); > + objectStore.createIndex("anniversary", "properties.anniversary", { > + multiEntry: true Bday and anniversary are not arrays, why do you need multiEntry here? @@ +368,4 @@ > } > > // Increment the DB revision on future schema changes as well > + if (currVersion > 11) { You shouldn't change this one, it's supposed to increment the revision for future schema changes, starting from version 10. @@ +826,5 @@ > if (DEBUG) debug("ContactDB:find val:" + aOptions.filterValue + " by: " + aOptions.filterBy + " op: " + aOptions.filterOp); > let self = this; > this.newTxn("readonly", STORE_NAME, function (txn, store) { > + let filterOps = ["equals", "contains", "match", "startsWith", "upper", > + "lower"]; Maybe we should go with lessThan and largerThan? Upper and lower makes me think of letter cases. ::: dom/contacts/tests/test_contacts_basics.html @@ +730,5 @@ > + req = mozContacts.find(options); > + req.onsuccess = function () { > + is(req.result.length, 1, "Found exactly 1 contact."); > + findResult1 = req.result[0]; > + ok(findResult1.id == sample_id1, "Same ID"); nit: I know it's not your fault, you just copied the existing tests, but please replace these ok() calls with is() :)
Comment 4•11 years ago
|
||
Comment on attachment 758615 [details] [diff] [review] wip Review of attachment 758615 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/contacts/fallback/ContactDB.jsm @@ +354,5 @@ > }; > } else if (currVersion == 10) { > if (DEBUG) debug("Adding object store for database revision"); > db.createObjectStore(REVISION_STORE).put(0, REVISION_KEY); > + } else if (currVersion == 11) { You have to check if you already have an objectstore here. @@ +368,4 @@ > } > > // Increment the DB revision on future schema changes as well > + if (currVersion > 11) { We should have a better comment here saying "Don't change" @@ +888,5 @@ > let index = store.index("telMatch"); > let normalized = PhoneNumberUtils.normalize(options.filterValue, > /*numbersOnly*/ true); > request = index.mozGetAll(normalized, limit); > + } else if (options.filterOp ==="upper" || options.filterOp === "lower") { nit: space after ===
Attachment #758615 -
Flags: feedback?(anygregor) → feedback+
Comment 5•11 years ago
|
||
(In reply to Fernando Jiménez Moreno [:ferjm] (needinfo instead of CC, please) from comment #1) > Blocks bug 862385 which is leo+, so leo? leo+
blocking-b2g: leo? → leo+
Reporter | ||
Comment 6•11 years ago
|
||
Actually, this doesn't block bug 862385 anymore. Sorry for the change of plans. I'll still work on this though.
No longer blocks: 862385
Reporter | ||
Updated•11 years ago
|
blocking-b2g: leo+ → leo?
Comment 7•11 years ago
|
||
What user scenario would we consider blocking this for at this point? Or is this just leo-
Reporter | ||
Comment 8•11 years ago
|
||
I would say that this is a leo-. Sorry for throwing it again for triage, but I have not the permissions to set the leo- flag myself.
Reporter | ||
Comment 10•11 years ago
|
||
Attachment #758615 -
Attachment is obsolete: true
Attachment #762656 -
Flags: review?(anygregor)
Reporter | ||
Updated•11 years ago
|
Summary: [Contacts API] Allow 'upper' and 'lower' options in nsIContactFindOptions.filterOps → [Contacts API] Allow 'higherThan' and 'lowerThan' options in nsIContactFindOptions.filterOps
Comment 11•11 years ago
|
||
Comment on attachment 762656 [details] [diff] [review] v1 Review of attachment 762656 [details] [diff] [review]: ----------------------------------------------------------------- Looks good! Thanks! ::: dom/contacts/fallback/ContactDB.jsm @@ +363,5 @@ > + } > + > + objectStore.createIndex("published", "published"); > + objectStore.createIndex("updated", "updated"); > + objectStore.createIndex("birthday", "properties.bday"); I think we should stick with our field names: bday ::: dom/contacts/tests/test_contacts_basics.html @@ +1621,5 @@ > + ok(true, "Expected error"); > + next(); > + }; > + }, > + function () { Please also add a test where we filter by "tel" and another field so we end up in the onerror callback.
Attachment #762656 -
Flags: review?(anygregor) → review+
Updated•11 years ago
|
Status: NEW → ASSIGNED
Whiteboard: c= → [c= ]
Reporter | ||
Comment 13•11 years ago
|
||
I am not currently working on this, so feel free to take it.
Assignee: ferjmoreno → nobody
Flags: needinfo?(ferjmoreno)
Updated•11 years ago
|
Component: DOM: Device Interfaces → DOM: Contacts
Updated•10 years ago
|
Priority: -- → P4
Whiteboard: [c= ] → [c= p= s= u=]
Updated•10 years ago
|
Status: ASSIGNED → NEW
Comment 14•6 years ago
|
||
DOM: Contacts isn't used anymore. Closing all remaining bugs.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Updated•6 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•