Closed Bug 1106499 Opened 10 years ago Closed 10 years ago

RoomsDB: Filter by user and then sort.

Categories

(Firefox OS Graveyard :: Gaia::Loop, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: frsela, Assigned: frsela)

References

Details

Attachments

(1 file)

This is a follow-up bug of #1101490 The objective is to allow multi-user database so getAll method shall filter by logged user and then sort items. Currently only sort or filter is allowed. Landed code is sorting, this change will filter: diff --git a/app/js/helpers/rooms_db.js b/app/js/helpers/rooms_db.js index 8295336..041845c 100644 --- a/app/js/helpers/rooms_db.js +++ b/app/js/helpers/rooms_db.js @@ -191,6 +191,10 @@ aFilter.sortedBy = field; } aFilter.prev = (sorting === 'DESC' ? 'prev' : null); + aFilter.index = { + name: 'user', + value: Controller.identity + }; return new Promise(function(resolve, reject) { _dbHelper.getList(function(error, cursor) { if (error) {
Blocks: 1097722
No longer depends on: 1101490
Attached file Github pull request
This is a proof of concept. It can be optimized :)
Attachment #8531188 - Flags: feedback?(crdlc)
Attachment #8531188 - Flags: feedback?(borja.bugzilla)
Comment on attachment 8531188 [details] [review] Github pull request I really don't see that implementation. I have in my mind something like this http://pastebin.com/PnjmqeYJ. What do you think?
Attachment #8531188 - Flags: feedback?(crdlc)
Assignee: nobody → frsela
Status: NEW → ASSIGNED
Attachment #8531188 - Flags: feedback?(borja.bugzilla) → review?(crdlc)
Comment on attachment 8531188 [details] [review] Github pull request Excellent work!! Many thanks!
Attachment #8531188 - Attachment description: Proof of concept → Github pull request
Attachment #8531188 - Flags: review?(crdlc) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: