You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both come from the database. createVertexType (packages/graph-explorer/src/core/entities/vertex.ts:94-96) is return type as VertexType, a cast with no validation or escaping, and connectors build vertex and edge types straight from the query response.
So a label containing a double quote closes the attribute selector early and produces a malformed one. Cytoscape cannot match it, and every style for that type is silently dropped. For a vertex type that is color, shape, border, and icon. For an edge type it is line color, line style, arrows, and label color. The element falls back to default styling with nothing in the UI to explain it. Custom styling for that type also appears to do nothing, which is the confusing part for a user.
The edge case is confirmed on a live graph. On Neptune 1.4.7.0, an edge type containing " makes the graph view log The selector `edge[type="GXW_dq"x"]` is invalid to the console three times, and nothing appears in the UI.
A type containing ] or \ is likely affected the same way. Worth checking both while fixing.
This is long-standing, not a regression.
Environment
Found by code inspection rather than a report, so this is not environment specific.
Graph Database & Version: any. Reachable on any database that permits a quote in a label, which includes openCypher backtick-quoted labels and SPARQL type IRIs.
Steps to Reproduce
Connect to a graph containing a vertex type or edge type whose label contains a " character.
Open the graph view and add a node of that type, or a node with an edge of that type.
Give that type a custom color or icon in node styling, or a custom line color or style in edge styling.
The element keeps default styling and the customization has no visible effect.
Expected Behavior
Styling applies to every vertex type and edge type regardless of the characters in its label, or the type is rejected at the boundary with a clear error. Either way, styling should never fail silently.
Escaping at the selector is the small fix: escape " and \ when building both selectors, or reject invalid types in createVertexType and createEdgeType instead of casting.
Resolving styling off selectors entirely, which #2111 is scoping, deletes this code path and the bug with it. #2104 already replaced the schema view's per-type selectors with a single node/edge rule; the graph viewer still builds one selector per type. If #2111 lands soon, this issue is better closed by that work than patched ahead of it.
Description
useGraphStylesbuilds each per-type cytoscape selector by interpolating the type directly into a string, for vertex types and edge types alike:Both come from the database.
createVertexType(packages/graph-explorer/src/core/entities/vertex.ts:94-96) isreturn type as VertexType, a cast with no validation or escaping, and connectors build vertex and edge types straight from the query response.So a label containing a double quote closes the attribute selector early and produces a malformed one. Cytoscape cannot match it, and every style for that type is silently dropped. For a vertex type that is color, shape, border, and icon. For an edge type it is line color, line style, arrows, and label color. The element falls back to default styling with nothing in the UI to explain it. Custom styling for that type also appears to do nothing, which is the confusing part for a user.
The edge case is confirmed on a live graph. On Neptune 1.4.7.0, an edge type containing
"makes the graph view logThe selector `edge[type="GXW_dq"x"]` is invalidto the console three times, and nothing appears in the UI.A type containing
]or\is likely affected the same way. Worth checking both while fixing.This is long-standing, not a regression.
Environment
Found by code inspection rather than a report, so this is not environment specific.
mainat 5a50963)Steps to Reproduce
"character.Expected Behavior
Styling applies to every vertex type and edge type regardless of the characters in its label, or the type is rejected at the boundary with a clear error. Either way, styling should never fail silently.
Notes
Two ways to fix, and the choice depends on #2111.
Escaping at the selector is the small fix: escape
"and\when building both selectors, or reject invalid types increateVertexTypeandcreateEdgeTypeinstead of casting.Resolving styling off selectors entirely, which #2111 is scoping, deletes this code path and the bug with it. #2104 already replaced the schema view's per-type selectors with a single
node/edgerule; the graph viewer still builds one selector per type. If #2111 lands soon, this issue is better closed by that work than patched ahead of it.Related Issues
Important
Internal only — this issue is maintained by the core team and is not accepting external contributions.