darodriguezalv / mytracks

Automatically exported from code.google.com/p/mytracks
0 stars 0 forks source link

New Sort Tracks are now at bottom of the list. Updated to latest version as of 03/27/2013 then started. #1282

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create a new track the save it
2.New track is not at the top of the list
3.New track is at bottom of track, above last track created with this problem.
4.switching back to old version does not help.  
5. restoring old data does not help

Each new track is supposed to be added to the top of the list, not start adding 
to the bottom of the list, and working upward, under all my old tracks.

What version of MyTracks are you using? On what version of Android? On what
phone?  Version 2.0.4. on Droid Bionic.

If possible please provide a log by uploading here.
Detailed instructions can be found here:
http://code.google.com/p/mytracks/wiki/HowToReportErrors

Please provide any additional information here:

Original issue reported on code.google.com by boobietr...@gmail.com on 31 Mar 2013 at 2:05

GoogleCodeExporter commented 9 years ago
In version 2.0.4, tracks are now sorted by starting time.

Are you still having issue, can you send a screenshot?

Original comment by jshih@google.com on 11 Apr 2013 at 6:38

GoogleCodeExporter commented 9 years ago
I still have the same problem.

See attached... 2010 items are above yesterday's items.

Original comment by boobietr...@gmail.com on 11 Apr 2013 at 6:50

GoogleCodeExporter commented 9 years ago
You didn't attach the screenshot.

The sorting order is "TracksColumns.STARTTIME DESC"

It is possible that your 2010 items have a STARTTIME that is undefined or 
invalid.

Can you export one of these items (in kml format) that is above yesterday's 
items and share it.

Thanks
Jimmy

Original comment by jshih@google.com on 15 Apr 2013 at 8:01

GoogleCodeExporter commented 9 years ago
I took every item that was old, yet at the top of my list, and went into
edit mode, then immediately after this I resaved.

This put each item back in chronological order.

Thanks!

Original comment by boobietr...@gmail.com on 17 Apr 2013 at 10:21

GoogleCodeExporter commented 9 years ago

Original comment by jshih@google.com on 18 Apr 2013 at 5:16

GoogleCodeExporter commented 9 years ago
I (and one of my friends) have devices that are also seeing this issue. editing 
and saving ~400 tracks is not a feasible workaround for me.

I think I have found the root cause of the problem.

if I'm reading the code correctly, it appears mytracks is sorting not quite by
  TracksColumns.STARTTIME DESC
but actually by
  TracksColumns.SHAREDWITHME + " ASC, " + TracksColumns.STARTTIME + " DESC"

(at ~line 432 of 
MyTracks/src/com/google/android/apps/mytracks/TrackListActivity.java)

and I believe the problem (with my mytracks.db at least) is that old tracks in 
the database have SHAREDWITHME of "NULL", wheras on new tracks SHAREDWITHME is 
"0".

this difference is causing segregation of old (NULL) tracks from new (0) 
tracks. eg. a text .dump of mytracks.db and then some grep/sed/awk shows that 
tracks recorded in the order a,b,c,d are displayed by this newer mytracks 
version as below:

SHAREDWITHME, STARTTIME, NAME, DESC
-----------------------------------------
NULL, 1362812758601, 2013/03/09 6:05pm, b
NULL, 1362810305318, 2013/03/09 5:25pm, a
   ... many older tracks here ...
0,    1364356088239, 2013/03/27 2:48pm, d
0,    1364284995008, 2013/03/26 7:03pm, c

the attached patch might fix it, +/- I don't know much java, nor what the usual 
values of SHAREDWITHME are supposed to be.

Original comment by plaguedb...@gmail.com on 22 Apr 2013 at 3:40

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by jshih@google.com on 22 Apr 2013 at 4:50

GoogleCodeExporter commented 9 years ago
I have the same problem, and fixed it with procedure from post #4, thanks.
v2.0.4 and Sony-Ericsson Mini pro 

Original comment by j40500...@gmail.com on 5 May 2013 at 3:43

GoogleCodeExporter commented 9 years ago
Thanks. Will be fixed in version 2.0.5. Changed the sql query to 
"IFNULL(" + TracksColumns.SHAREDWITHME + ",0) ASC, " + TracksColumns.STARTTIME 
+ " DESC"

Original comment by jshih@google.com on 10 Jun 2013 at 9:08

GoogleCodeExporter commented 9 years ago
Issue 1289 has been merged into this issue.

Original comment by jshih@google.com on 17 Jun 2013 at 8:06