The node render service (tools/render) already produces every diagram figure the site offers, drawn by the site's own renderer rather than a second reimplementation of it. It answers on /RenderService/render/<id>.<ext>, a path that exists on beta and not on production.
That extra path is the problem. The figures it makes are the ones /ContentService/exporter/diagram/<id>.<ext> and /exporter/reaction/<id>.<ext> have always made, so a second URL for the same thing means external consumers keep the old one, our own tests cannot assert against a path that exists everywhere, and the two can drift.
Proposal: node answers the existing ContentService paths, with Tomcat behind it as a backup upstream — the arrangement already proven for /data/content/ in #269. Nothing outside has to change, and anything node does not answer still reaches Java.
What already lines up
/render/:name.:ext is the same request in different clothes: token → token, sel → select, view → view, plus our own subpathways, dark and scale. The routing is an nginx location for the prefix pointing at the node upstream.
What has to be closed first
jpeg and jpg. Java's enum is png, jpg, jpeg, svg, gif; the render service is svg, png, pdf, gif, pptx and returns 400 for jpeg. Taking the path over without it is a format regression. Small: the canvas is already there, and ehld.service.ts already handles JPEG having no alpha channel.
Eleven parameters we do not implement: quality, flg, flgInteractors, title, margin, ehld, diagramProfile, analysisProfile, resource, expColumn, includeRef. Our own site uses almost none of them, but this is a public URL and we cannot enumerate who calls it. Each needs a decision — honour it, or reject the request naming the parameter. Ignoring one silently is the outcome to avoid: flg dropped on the floor renders a figure without the flagged entity and returns 200, which no caller can detect.
Rate limiting in front, before the switch, not after. A render costs seconds where a static file costs milliseconds, and this path is public and crawled. That work is already on the list before the render service can front reactome.org; this issue depends on it rather than repeating it.
Why it is likely to be an improvement rather than a risk
The render service answers 503 beyond a bounded queue instead of accumulating work, caches on the request, and coalesces concurrent requests for the same pathway into one render — four concurrent became one, measured. The exports it replaces have none of that.
What it unblocks
Five tests in e2e/downloads.spec.ts assert on figure formats and are gated on the render service being up. CI does not run it, so they never execute there; where it is running they fail for want of a recording. Once the figures come from a path that exists on every deployment, those assertions can live in the release suite and run against real output.
Order
- add
jpeg/jpg
- decide each unimplemented parameter: honour, or reject naming it
- rate limiting in front
- route the two paths to node with Tomcat as backup
- move the figure-format assertions to the release suite
The node render service (
tools/render) already produces every diagram figure the site offers, drawn by the site's own renderer rather than a second reimplementation of it. It answers on/RenderService/render/<id>.<ext>, a path that exists on beta and not on production.That extra path is the problem. The figures it makes are the ones
/ContentService/exporter/diagram/<id>.<ext>and/exporter/reaction/<id>.<ext>have always made, so a second URL for the same thing means external consumers keep the old one, our own tests cannot assert against a path that exists everywhere, and the two can drift.Proposal: node answers the existing ContentService paths, with Tomcat behind it as a
backupupstream — the arrangement already proven for/data/content/in #269. Nothing outside has to change, and anything node does not answer still reaches Java.What already lines up
/render/:name.:extis the same request in different clothes:token→token,sel→select,view→view, plus our ownsubpathways,darkandscale. The routing is an nginx location for the prefix pointing at the node upstream.What has to be closed first
jpegandjpg. Java's enum ispng, jpg, jpeg, svg, gif; the render service issvg, png, pdf, gif, pptxand returns 400 for jpeg. Taking the path over without it is a format regression. Small: the canvas is already there, andehld.service.tsalready handles JPEG having no alpha channel.Eleven parameters we do not implement:
quality,flg,flgInteractors,title,margin,ehld,diagramProfile,analysisProfile,resource,expColumn,includeRef. Our own site uses almost none of them, but this is a public URL and we cannot enumerate who calls it. Each needs a decision — honour it, or reject the request naming the parameter. Ignoring one silently is the outcome to avoid:flgdropped on the floor renders a figure without the flagged entity and returns 200, which no caller can detect.Rate limiting in front, before the switch, not after. A render costs seconds where a static file costs milliseconds, and this path is public and crawled. That work is already on the list before the render service can front reactome.org; this issue depends on it rather than repeating it.
Why it is likely to be an improvement rather than a risk
The render service answers 503 beyond a bounded queue instead of accumulating work, caches on the request, and coalesces concurrent requests for the same pathway into one render — four concurrent became one, measured. The exports it replaces have none of that.
What it unblocks
Five tests in
e2e/downloads.spec.tsassert on figure formats and are gated on the render service being up. CI does not run it, so they never execute there; where it is running they fail for want of a recording. Once the figures come from a path that exists on every deployment, those assertions can live in the release suite and run against real output.Order
jpeg/jpg