Skip to content

Escape backslashes in DotGraph values#7606

Merged
labkey-tchad merged 2 commits intodevelopfrom
fb_experimentGraphUpdate
Apr 22, 2026
Merged

Escape backslashes in DotGraph values#7606
labkey-tchad merged 2 commits intodevelopfrom
fb_experimentGraphUpdate

Conversation

@labkey-tchad
Copy link
Copy Markdown
Member

@labkey-tchad labkey-tchad commented Apr 20, 2026

Rationale

We aren't escaping backslashes in our generated DotGraph. This can end up generating invalid DOT syntax.

The actual label in the following DOT snippet is intended to be ,\"^:}}"#)B-d@x.Db&-. We correctly escape the quote but not the backslash:

M27231[label=",\\"^:}}\"#)B-d@x.Db&-", tooltip="Material: ,\\"^:}}\"#)B-d@x.Db&-", etc.]

The parser then decodes the double-backslash and leaves the following quote unescaped:

org.graphper.parser.ParseException: line 4:18 token recognition error at: '^'
	at org.graphper.parser.DotSyntaxErrorListener.syntaxError(DotSyntaxErrorListener.java:40)
	[...]
	at org.labkey.experiment.ExperimentRunGraph.getSvg(ExperimentRunGraph.java:53)
	at org.labkey.experiment.ExperimentRunGraph.renderSvg(ExperimentRunGraph.java:46)

This is a pre-existing defect (reproduced in 25.7) but didn't cause any test failures because we didn't log errors returned by dot execution.

Related Pull Requests

Changes

  • Escape backslashes in DotGraph values

@labkey-tchad labkey-tchad self-assigned this Apr 20, 2026
Copy link
Copy Markdown
Contributor

@labkey-adam labkey-adam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any tests for this?

@labkey-tchad
Copy link
Copy Markdown
Member Author

Do we have any tests for this?

Not explicitly but SampleTypeDeriveRunProvenanceTest generates random sample names that tend to trigger this error.

@labkey-tchad labkey-tchad merged commit 3796d43 into develop Apr 22, 2026
6 of 7 checks passed
@labkey-tchad labkey-tchad deleted the fb_experimentGraphUpdate branch April 22, 2026 15:35
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

Successfully merging this pull request may close these issues.

2 participants