CloudDB does not generate DataChanged event

Just tried, and yes, it throws a JSONException

EDIT: It throws JSONException for string input with command set "x:val" "\"50|60|70\""

But it doesn't throw any exception with array input with command set "x:val" "[50,60,70]"
Even though no exception is thrown in this case, DataChanged event does not get triggered.


The log was as follows -
02-12 01:53:51.701 4008 4056 E JsonUtil: JSONException
02-12 01:45:23.224 4008 4056 E JsonUtil: org.json.JSONException: Value 150,200,600 of type java.lang.String cannot be converted to JSONArray
02-12 01:45:23.224 4008 4056 E JsonUtil: at org.json.JSON.typeMismatch(JSON.java:111)
02-12 01:45:23.224 4008 4056 E JsonUtil: at org.json.JSONArray.(JSONArray.java:96)
02-12 01:45:23.224 4008 4056 E JsonUtil: at org.json.JSONArray.(JSONArray.java:108)
02-12 01:45:23.224 4008 4056 E JsonUtil: at com.google.appinventor.components.runtime.util.JsonUtil.getJsonRepresentationIfValueFileName(JsonUtil.java:385)
02-12 01:45:23.224 4008 4056 E JsonUtil: at com.google.appinventor.components.runtime.CloudDB$3.run(CloudDB.java:793)
02-12 01:45:23.224 4008 4056 E JsonUtil: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
02-12 01:45:23.224 4008 4056 E JsonUtil: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
02-12 01:45:23.224 4008 4056 E JsonUtil: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
02-12 01:45:23.224 4008 4056 E JsonUtil: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
02-12 01:45:23.224 4008 4056 E JsonUtil: at java.lang.Thread.run(Thread.java:818)

Well, I also tried creating a JSON object and serializing it with ArduinoJSON library, and then passing it to the Redis server.
Still the DataChanged event doesn’t get triggered.

@ewpatton Could you please explain the JSON hierarchy that CloudDB uses?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.