-
Notifications
You must be signed in to change notification settings - Fork 382
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
Record Set JsonPath with numeric parts that are not array indices returned different results on client vs server side #651
Comments
Btw, much of our data is deeply nested json objs with numerous objects members having numeric fieldnames. These are automated transforms in another ETL application, not possible to refactor easily. |
The numeric fieldnames also help significantly as the number of records scales due to memory usage for each fieldname's length for every obj. Smaller fieldnames = smaller objects = smaller data stores = less bandwidth. |
We also don't want the added padding of nulls in sparse arrays of slotted values. |
this is probably related to the issue #646 I have posted earlier. The fix is also posted. I hope they patch it soon |
@WolframHempel @yasserf @AlexBHarley |
honorcode_deepstream_io_patch_fix_json_path_numeric_obj_member_support.diff (ok - .diff file type not supported so I guess I'll include my two .js files (json-path.js and json-pathSpec.js) as .txt files below. |
Summary: |
@WolframHempel @yasserf @AlexBHarley |
unsure of priority for this issue. script:
|
Closing in favour of #1046 |
Using localhost (Mac osx) Deepstream.io 2.2.0, Java Client 2.0.8, no plugins
Upon setRecord(recId, "a.b.1", value) the end result of set shows the path created to be:
{ "a": { "b": { "1": value } } }
Problem: data-sync/getRecord returns this record which does not match and will fail gson.toJson(elem):
{ "a": { "b": [ null, value ] } }
Example Test:
setRecord runtime breakpoint below ->
In UtilJsonPath.java :: setIterateThrough @ line 52
private static JsonElement setIterateThrough(JsonElement element, String path, JsonElement value, boolean delete)
... breakpoint at line 92: updateValue(value, (JsonElement)parent, token, delete);
where runtime vars:
element = {"tickets":{"ticketTexts":{"1":{}}}}
value = "BDD TESTING"
token = "1"
path = "tickets.ticketTexts.1"
parent = "{"1":{}}"
delete = false
BUT upon setRecord completing the data-sync'd record and / or subsequent getRecord returns this:
{"tickets":{"ticketTexts":[null,"BDD TESTING"]}}
The text was updated successfully, but these errors were encountered: