-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
#603: BugFix : Handle root path '.' correctly in JSON.OBJLEN command #976
#603: BugFix : Handle root path '.' correctly in JSON.OBJLEN command #976
Conversation
Hey @JyotinderSingh @lucifercr07 , request you to review this. |
Hi @iamskp11 . I would love to know how you got this in your output in DiceCLI. Currently in DiceCLI, when we execute JSON.OBJLEN, we are getting something like this So I see that you have made some changes in the code which corrected the output. I want to know how you got it worked. Thanks in advance |
Hey @surya0180 , if we get something like
|
@iamskp11. I have tried doing clientio.encode(1, false), but unlike other commands, most of the JSON commands are printing strings instead of integers. I even tried hardcoding the numbers instead of app logic, even then its still printing a string instead of (integer) 5. What might be this issue? |
@surya0180 Not sure why this happens. Saw your inconsistency reporting on JSON.ARRLEN, and I verified it myself. I can see correct integer results for Dice-CLI. |
What!!!!!!!! Let me try to update my codebase and try again |
@iamskp11 , BTW can you tell me in which environment you are running your app? |
Go -> 1.23.1 |
@iamskp11 I updated my repo and still seeing the same output. But this is not the case in redis-cli. I can see the right output in redis unlike dice-cli. Are you sure you haven't changed anything which might be the reason you are seeing the right output? Just askng because even one of my friend is also seeing the string instead of integer |
Yes, haven't changed/done anything different.
|
@iamskp11 Will do these |
Hi @iamskp11 it looks like an issue in how the terminal is printing the buffer array. The test cases are passing successfully for JSON commands. But this is still an issue because these commands are working fine in redis-cli. Thanks for the help. I will take it from here 👍 |
…andling-in-json-objlen
…andling-in-json-objlen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the late review. But it looks like the changes in this PR are out of date now given the recent changes in the codebase. Could you please update it?
We have migrated the OBJLEN implementation to the resp server, therefore the tests will also need to be migrated accordingly. I was taking a look at the modified parse method but it looks like it is no longer being used anywhere.
The tests look good overall, we can merge this once this comment is addressed.
@JyotinderSingh , will be adding commits soon. |
@JyotinderSingh the changes are done, in line with migrated code, and also all tests are added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this fix, the changes look good and well tested. LGTM.
Fixes #603 . Adds differentiation between Legacy and JSON Path syntax.
Basically, every path that doesn't starts with "$" is Legacy Path syntax. And, it resolves to first path in JSON, irrespective of multiple matching paths. Have handled that accordingly in the OBJLEN flow. Added tests to validate it.
Above are snippets from Redis JSONPath Documentation.
Below is the response similarity between DiceDB(left) and Redis on same commands.