Closed
Bug 965312
Opened 11 years ago
Closed 8 years ago
Evaluate having an option for specifying the cursor direction when retrieving message threads
Categories
(Firefox OS Graveyard :: RIL, defect)
Tracking
(blocking-b2g:-)
RESOLVED
WONTFIX
blocking-b2g | - |
People
(Reporter: gsvelto, Assigned: gsvelto)
Details
Attachments
(2 files, 1 obsolete file)
34.00 KB,
patch
|
vicamo
:
superreview+
|
Details | Diff | Splinter Review |
5.98 KB,
patch
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #963475 +++ As discussed in bug 963475 we might want to add an option to specify in which order the threads retrieved via MozMobileMessageManager.getThreads() are returned. We have a similar option for MozMobileMessageManager.getMessages() and it's specified as an optional boolean parameter. As :rwaldron pointed out in bug 963475 comment 13 this is not very readable by someone who's not already familiar with the API. Instead an optional options object (no pun intended) can be passed, e.g.: * Default order of retrieval MozMobileMessageManager.getThreads() or MozMobileMessageManager.getThreads({ reverse: false }) * Reversed order of retrieval MozMobileMessageManager.getThreads({ reverse: true }) For both better readability and consistency we might modify MozMobileMessageManager.getMessages's second parameter accordingly.
Assignee | ||
Comment 1•11 years ago
|
||
Assignee | ||
Comment 2•11 years ago
|
||
Assignee | ||
Comment 3•11 years ago
|
||
Assignee | ||
Comment 4•11 years ago
|
||
Comment on attachment 8373365 [details] [diff] [review] [PATCH] Add an options object to specify the order of retrieval of messages and threads This is my proposed change to the MozMobileMessageManager API that uses an options object to pass optional parameters to the getThreads() and getMessages() calls. In this case I've implemented the |reverse| parameter that was already available in getMessages() and I've extended it to cover getThreads() too. I had only a couple of answers on dev-webapi about this but both seemed positive so I think it should be OK to go ahead with it. I've also attached a Gaia patch that modifies the SMS app to make use of the new parameters.
Attachment #8373365 -
Flags: feedback?(vyang)
Comment 5•11 years ago
|
||
This looks really good, thank you for addressing the argument form :)
Comment 6•10 years ago
|
||
Comment on attachment 8373365 [details] [diff] [review] [PATCH] Add an options object to specify the order of retrieval of messages and threads Review of attachment 8373365 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/mobilemessage/src/MobileMessageManager.cpp @@ +402,5 @@ > if (!filter) { > filter = new SmsFilter(); > } > > + if (aArgc == 1) { aArgc == 2 ::: dom/mobilemessage/tests/marionette/test_getthreads.js @@ +166,2 @@ > "' should be found in bodies array."); > + messageCount++; The problem here is, there might be two messages of the same timestamp. SMS timstamps are of seconds. It's quite possible that in our testing environment, especially running on your mighty desktop beast, to have two messages of identical timestamp. For these messages, their order in the output of |getMessages| is undefined, and therefore we cannot assume an absolutely increasing order here.
Attachment #8373365 -
Flags: feedback?(vyang) → superreview+
Assignee | ||
Comment 7•10 years ago
|
||
(In reply to Vicamo Yang [:vicamo][:vyang] from comment #6) > ::: dom/mobilemessage/src/MobileMessageManager.cpp > @@ +402,5 @@ > > if (!filter) { > > filter = new SmsFilter(); > > } > > > > + if (aArgc == 1) { > > aArgc == 2 Strangely enough that doesn't seem to work. It seems that aArgc == 0 if I pass only one argument and aArgc == 1 if I pass two. Is it possible it's counting only the optional arguments and not the required ones? > ::: dom/mobilemessage/tests/marionette/test_getthreads.js > @@ +166,2 @@ > > "' should be found in bodies array."); > > + messageCount++; > > The problem here is, there might be two messages of the same timestamp. SMS > timstamps are of seconds. It's quite possible that in our testing > environment, especially running on your mighty desktop beast, to have two > messages of identical timestamp. For these messages, their order in the > output of |getMessages| is undefined, and therefore we cannot assume an > absolutely increasing order here. I'm not exactly sure how this affects that particular bit of code; the tests seem to pass on my machine though. Do you mean this might introduce intermittent issues if we end up with two messages with the same timestamp?
Updated•10 years ago
|
blocking-b2g: --- → backlog
Updated•10 years ago
|
blocking-b2g: backlog → -
Assignee | ||
Comment 8•8 years ago
|
||
We will most likely remove this API.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•