Bug 12569 - 7.4 sends id's and text as numerals instead of strings (as before) in SlimJSON
: 7.4 sends id's and text as numerals instead of strings (as before) in SlimJSON
Status: NEW
Product: Logitech Media Server
Classification: Unclassified
Component: CLI
: 7.4.0
: All All
: P1 normal with 2 votes (vote)
: 8.0.0
Assigned To: Andy Grundman
: ipeng
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-28 05:28 UTC by Joerg Schwieder
Modified: 2009-07-29 14:59 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Schwieder 2009-06-28 05:28:42 UTC
If sending SlimJSON encoded data, SS 7.4 sends item IDs encoded as numbers, the versions before used strings.

This crashes iPeng.

Tested on r27258
This is true at least for albums

Also, if an item's text field in SlimBrowse menus (which definitely should be a string) is being encoded as a number if it contains a numeric value as is true for the "Years" menu.

The really funny thing about the latter one is that it this goes away when I enable debug.cometd!!!!!!
Could the debug setting have some influence on the actual SlimJSON processing on the server side?

Here's some of the (broken) data, as you can see, the "text" item is encoded as a number rather than a string as it definitely should be ("1964" here is supposed to be the string to display).

[
	{
		"data":{
			"base":{

...

				},
				"window":{
					"titleStyle":"years",
					"menuStyle":"album"
				}
			},
			"count":32,
			"item_loop":[
				{
					"params":{
						"favorites_title":0,
						"favorites_url":0,
						"year":0
					},
					"text":"Unknown"
				},
				{
					"params":{
						"favorites_title":1964,
						"favorites_url":"db:year.id=1964",
						"year":1964
					},
					"text":1964
				},
				{
					"params":{
						"favorites_title":1966,
						"favorites_url":"db:year.id=1966",
						"year":1966
					},
					"text":1966
				},
...
Comment 1 Andy Grundman 2009-06-28 06:46:29 UTC
Yep the fact that it goes away when debugging is because Data::Dump causes the value to be evaluated in a certain way, which affects how JSON::XS encodes it.
Comment 2 Andy Grundman 2009-07-29 14:59:28 UTC
Moving 7.4 bugs to 8.0.