Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3062] JSON.parse changes order of data

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Do
Resolution Date2020-01-09T18:50:35.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterMadhava Jay
AssigneeIngo Muschenetz
Created2011-04-15T03:35:50.000+0000
Updated2020-01-09T18:50:35.000+0000

Description

I am using Mobile SDK 1.5.1 and when I recieve JSON from my server, I can see its in a particular order.
These are reverse order timestamp posts from a phpBB forum.

When I JSON.parse the response I get them in a different order on both Android and iOS.
If I run eval the results are in the correct original order.

I can see with Ti.API.info that the app is getting the original JSON in the correct order.

Heres how the JSON looks:

{
"3":{ "isUnread":"", "title":"Games", "replies":"1987", "startedBy":"User", "lastPostTime":"Mon Oct 04, 2010 8:39 pm", "lastPostBy":"User", "lastPosterUID":"4" },
"5":{ "isUnread":"", "title":"General", "replies":"2689", "startedBy":"User", "lastPostTime":"Mon Oct 04, 2010 8:38 pm", "lastPostBy":"User", "lastPosterUID":"4" }, 
"163":{ "isUnread":"", "title":"Europeland", "replies":"313", "startedBy":"User", "lastPostTime":"Mon Oct 04, 2010 8:00 pm", "lastPostBy":"User", "lastPosterUID":"2" },
"END":"END"
}

Comments

  1. Eduardo Gomez 2011-06-21

    There is a HD ticket that encountered this issue on Android as well. http://support.appcelerator.com/display/APP-127543 Targets: + **Product**: Mobile + **Titanium SDK**: Mobile 1.6.1 + **Platform OS**: Android + **Platform OS Version**: 2.3
  2. Alan Hutton 2020-01-09

    It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. Updating, or creating code may not reproduce the issue reported, or be a valid test case. If community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.

JSON Source