Last Comment Bug 769347 - B2G SMS: Messages returned from database should be sorted by time stamp.
: B2G SMS: Messages returned from database should be sorted by time stamp.
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: unspecified
: ARM Gonk (Firefox OS)
: -- normal (vote)
: mozilla16
Assigned To: Vicamo Yang [:vicamo][:vyang]
:
Mentors:
Depends on:
Blocks: 712809
  Show dependency treegraph
 
Reported: 2012-06-28 10:32 PDT by Steve Chung [:steveck]
Modified: 2012-07-09 04:49 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Screenshot about the incorrect message thread sequence (45.41 KB, image/jpeg)
2012-06-28 10:45 PDT, Steve Chung [:steveck]
no flags Details
order database query results by timestamp (1.67 KB, patch)
2012-06-28 11:01 PDT, Vicamo Yang [:vicamo][:vyang]
no flags Details | Diff | Review
order database query results by timestamp : V2 (1.90 KB, patch)
2012-07-03 22:35 PDT, Vicamo Yang [:vicamo][:vyang]
philipp: review+
Details | Diff | Review

Description Steve Chung [:steveck] 2012-06-28 10:32:05 PDT

    
Comment 1 Steve Chung [:steveck] 2012-06-28 10:43:36 PDT
This issue is also raised in github issue: https://github.com/mozilla-b2g/gaia/issues/2053#preview_bucket_971
Comment 2 Steve Chung [:steveck] 2012-06-28 10:45:33 PDT
Created attachment 637586 [details]
Screenshot about the incorrect message thread sequence
Comment 3 Vicamo Yang [:vicamo][:vyang] 2012-06-28 11:01:47 PDT
Created attachment 637592 [details] [diff] [review]
order database query results by timestamp

Inside SmsDatabaseService.keyIntersection(), the order of final results is the order of last keys array filtered. This patch always filters keys[FILTER_TIMESTAMP], so it should be always ordered by timestamp.
Comment 4 Philipp von Weitershausen [:philikon] 2012-07-02 18:54:06 PDT
(In reply to Vicamo Yang [:vicamo] from comment #3)
> Inside SmsDatabaseService.keyIntersection(), the order of final results is
> the order of last keys array filtered. This patch always filters
> keys[FILTER_TIMESTAMP], so it should be always ordered by timestamp.

Good hack. Can you add a comment explaining this side-effect? r=me with that.
Comment 5 Vicamo Yang [:vicamo][:vyang] 2012-07-03 22:35:01 PDT
Created attachment 638965 [details] [diff] [review]
order database query results by timestamp : V2

Address comment #4 from Philipp. Thank you.
Comment 6 Vicamo Yang [:vicamo][:vyang] 2012-07-03 22:44:37 PDT
Gaia fix is ready here(https://github.com/vicamo/gaia/tree/bugzilla/769347/master). I'll send a pull request once this is landed.
Comment 7 Vicamo Yang [:vicamo][:vyang] 2012-07-08 22:07:29 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/d3cfb134c625
Comment 8 Ed Morley [:emorley] 2012-07-09 04:49:29 PDT
https://hg.mozilla.org/mozilla-central/rev/d3cfb134c625

Note You need to log in before you can comment on or make changes to this bug.