Skip to content
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

Weird behaviour with quotes in object literals #710

Closed
steffansluis opened this issue Apr 18, 2018 · 2 comments
Closed

Weird behaviour with quotes in object literals #710

steffansluis opened this issue Apr 18, 2018 · 2 comments
Assignees
Milestone

Comments

@steffansluis
Copy link

steffansluis commented Apr 18, 2018

Ok, so I'm running tests on CircleCI 2.0 and one of the things I'm testing is testing for quad existence in Cayley with quads that have escaped double-quotes in them. Locally my build passed (using circleci build), but when running the build on CI, it fails. I SSHed into the container to do some manual tests, and to my surprise it is indeed broken. My setup is as follows:
Quads in DB:

<http://bla.com> <http://bla.com/text> "\"some quoted text\"" .

Commands executed on CI container:

root@1908bb72e157:~# curl -XPOST -d 'g.V("<http://bla.com>").Has("<http://bla.com/text>", "\"some quoted text\"").All();' localhost:64210/api/v1/query/gizmo
{"result":null}
root@1908bb72e157:~# curl -XPOST -d 'g.V("<http://bla.com>").All();' localhost:64210/api/v1/query/gizmo
{"result":[{"id":"\u003chttp://bla.com\u003e"}]}
root@1908bb72e157:~# curl -XPOST -d 'g.V("<http://bla.com>").Out().All();' localhost:64210/api/v1/query/gizmo
{"result":[{"id":"\"some quoted text\""}]}

At first I thought this was a CI problem, but having SSH'ed into the build and run the queries above, I'm really wondering what I'm missing here. I figured it might be some escaping issue between bash and JSON, or between goja and something else, so I tried escaping the quotes in the query with more slashes (to no avail). However, the exactly same query is working on another Cayley instance that runs on a Postgres DB outside of CI (so no timing issues and such), indicating that it shouldn't be goja. Furthermore, the CI uses BoltDB, but since the build functions locally with the same backend that should be the problem either. Any thoughts?

@steffansluis
Copy link
Author

Update: figured out what was causing the strange behaviour! Turns out I had a cached docker image locally (2da6e8126497a1d52919d27efad42dafeca2a9524f89bbc1fa9191165f77b7fb) on which the query does work, and the CI build was pulling the newer version of the image (1ca4d62f78fa50e1d85d71f60838fce47287d1d57b2775be1a1063625e76e1fc). Still not sure what is the underlying cause, will investigate further.

@steffansluis
Copy link
Author

The tag I'm referring to doesn't seem to exist on quay.io anymore. I've tested with the actual latest version of the image, as well as the v0.7.2, v0.7.0 and v0.6.0, all of which fail the query (possibly for different reasons). However, v0.7.0-alpha does work with the query (and is the version of the PG based instance I mentioned earlier). I think this is as I can trace the problem without actually going through all versions of the source code.

@dennwc dennwc self-assigned this Apr 23, 2018
@dennwc dennwc added this to the v0.7.3 milestone Apr 23, 2018
@dennwc dennwc closed this as completed in 009b1f6 Apr 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants