Azure / Azure/cosmos-explorer

Graph paging logic uses double-quotes which breaks if id contains $ sign

Open
#53 0 comments 0 reactions 1 assignee Claimed by @languy View on GitHub
bug
Dominant language
TypeScript
Stars
131
Forks
67
Avg merge
3d 13h
Merged PRs (30d)
10

Description

How to repro:
* Have more than 100 vertices in the graph
* At least one vertex has an `id` that contains `$`. For example: `foo$bar`.
* Execute `g.V()` and see the `ScriptError` coming out of the backend.

The problem:
Double-quoted strings denote Groovy string interpolation where ‘$’ denotes the beginning of a placeholder.
Eg.

"${cosmosAccount}" -- this is expected to be replaced with the value of variable cosmosAccount.

To avoid this and treat the entire string as a literal, single-quoted strings should be used.
Eg.
'$Default'

So the fix would be to ensure that the gremlin result pager uses single quoted strings for partition key/id values in the query builder.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.