Bug: Accessions Overview SSR
SSR with filter code applied uses a very strange API URL that does not exist /api/v1/acn/v18461d86381494a49a0faaa913f74c3da (/overview/
part is missing:
Opening beta.genesys-pgr.org/a/v18461d86381494a49a0faaa913f74c3da logs:
Incoming request, url: /a/v18461d86381494a49a0faaa913f74c3da
Backend API request to /api/v1/acn/v18461d86381494a49a0faaa913f74c3da
Incoming request, url: /proxy/api/v1/acn/v18461d86381494a49a0faaa913f74c3da
Will HTTP Proxy filter? true
HTTP proxy to https://api.genesys-pgr.org/api/v1/acn/v18461d86381494a49a0faaa913f74c3da
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
Error: Request failed with status code 404
at createError (/var/www/genesys-ui/server/server.js:1:432189)
at settle (/var/www/genesys-ui/server/server.js:1:434620)
at IncomingMessage.handleStreamEnd (/var/www/genesys-ui/server/server.js:1:423088)
at IncomingMessage.emit (events.js:202:15)
at endReadableNT (_stream_readable.js:1129:12)
at args.(anonymous function) (/usr/local/lib/node_modules/pm2/node_modules/event-loop-inspector/index.js:138:29)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
Server info fetched in 83ms
My guess is that the bug is caused in server.ts
in the redirect to DOI and it uses a regexp pattern that is way too broad:
:lang(/[a-z]{2})?/a/:uuid([a-z\\-0-9]+)
The pattern for uuid
must be better, maybe:
// 79480324-a570-494c-a33e-524ab1b91755
.{8}(\\-.{4}){3}\\-.{12}
React routes still work properly, because routes using filterCode
match before the route with uuid
.
Update
It's much worse, this bug affects any URL starting with /a/
.