Decodes less than and greater than operators in sanitized SQON before JSON parsing to prevent Unknown op error when downloading exports from Arranger
Context
Eva reported an issue (#1050) where she was unable to download the âExportâ TSV from the models table. Turns out itâs an issue with the âAge of Diagnosisâ filter sqon.
âAge of Diagnosisâ is a numeric facet, so it adds >= and/or <= operators to the sqon based on user input.
A couple years ago we started sanitizing the request params (req.sanitize(req.body.params)) to the api endpoint for triggering the TSV download. So itâs going from <= to <= in the sqon string before being parsed into JSON and sent to arranger to get the data for download. Arranger is strictly expecting<=, not the sanitized version, so it throws an Unknown op error and the download fails.
This fix uses a regex to decode the sanitized > and < back to > and < for Arranger.
Unknown op
error when downloading exports from ArrangerContext
Eva reported an issue (#1050) where she was unable to download the âExportâ TSV from the models table. Turns out itâs an issue with the âAge of Diagnosisâ filter sqon.
âAge of Diagnosisâ is a numeric facet, so it adds
>=
and/or<=
operators to the sqon based on user input.A couple years ago we started sanitizing the request params (
req.sanitize(req.body.params)
) to the api endpoint for triggering the TSV download. So itâs going from<=
to<=
in the sqon string before being parsed into JSON and sent to arranger to get the data for download. Arranger is strictly expecting<=
, not the sanitized version, so it throws anUnknown op
error and the download fails.This fix uses a regex to decode the sanitized
>
and<
back to>
and<
for Arranger.Deploy Instructions