Context
Raised during review of #1484.
CONFIGURE_WORKFLOW / CONFIGURE_ORGANISM_WORKFLOW in packages/shared/routes/constants.ts now embed a ?trsId={trsId} query string, which is filled by replaceParameters — a path tool doing a raw String.replace with no URL-encoding.
This works today only because every caller pre-sanitizes trsId to [a-zA-Z0-9-] (via formatTrsId). A future value containing &, =, #, or a space would break the URL silently. The ROUTES.CONFIGURE_ORGANISM_WORKFLOW.split("?")[0] in the e2e spec is a tell that a path constant is being used as something it isn't.
Proposal
Keep ROUTES entries as pure path templates and build the query string at the call site using URLSearchParams, e.g. a small helper:
buildConfigureWorkflowUrl(entityId, trsId) // -> "/data/assemblies/<id>/analyze/workflows?trsId=<encoded>"
Acceptance criteria
ROUTES contains no embedded query strings.
- Configure-workflow URLs are built via
URLSearchParams (proper encoding).
- No
.split("?") workarounds in tests.
Context
Raised during review of #1484.
CONFIGURE_WORKFLOW/CONFIGURE_ORGANISM_WORKFLOWinpackages/shared/routes/constants.tsnow embed a?trsId={trsId}query string, which is filled byreplaceParameters— a path tool doing a rawString.replacewith no URL-encoding.This works today only because every caller pre-sanitizes
trsIdto[a-zA-Z0-9-](viaformatTrsId). A future value containing&,=,#, or a space would break the URL silently. TheROUTES.CONFIGURE_ORGANISM_WORKFLOW.split("?")[0]in the e2e spec is a tell that a path constant is being used as something it isn't.Proposal
Keep
ROUTESentries as pure path templates and build the query string at the call site usingURLSearchParams, e.g. a small helper:Acceptance criteria
ROUTEScontains no embedded query strings.URLSearchParams(proper encoding)..split("?")workarounds in tests.