Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use _id instead of timestamp for sorting messages #136

Closed
dalb8 opened this issue Mar 14, 2014 · 5 comments
Closed

Use _id instead of timestamp for sorting messages #136

dalb8 opened this issue Mar 14, 2014 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@dalb8
Copy link

dalb8 commented Mar 14, 2014

Using 2.2.9 I received a notification which I pressed . The message, which was several days newer than the previous one, appeared at the top of the thread instead of as usual the bottom. The messages from this person are unencrypted for some reason. My reply appears just under this.

@daniele-athome
Copy link
Member

Did you recently changed your clock time or time zone?

@dalb8
Copy link
Author

dalb8 commented Mar 14, 2014

Yes, I just noticed this. Been installing kernels again!

@dalb8 dalb8 closed this as completed Mar 14, 2014
@daniele-athome
Copy link
Member

public static final String DEFAULT_SORT_ORDER = "timestamp";

Sort order is indeed by timestamp (Android ListView will reverse it), but I wonder if it's the right thing to do. I could order by message id: it's an atomic sequence number, so it will always order by date of creation in the local database.
What do you think?

@daniele-athome
Copy link
Member

I'll do some tests then.

@daniele-athome daniele-athome added this to the 3.0a6 milestone Mar 14, 2014
@daniele-athome daniele-athome self-assigned this Mar 14, 2014
@daniele-athome
Copy link
Member

It seems to work correctly (sqlite sequence number will restart when overflowed, this means something like an unsigned 64-bit number, which is really some lifetimes worth of messages).
I don't remember why I've used timestamp instead of _id in the first place...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants