serratus-bio / open-virome

monorepo for data explorer UI and APIs
http://openvirome.com/
GNU Affero General Public License v3.0
0 stars 0 forks source link

bug: Error parsing JSON response SyntaxError: Unexpected token 'W', "W3siY291bn"... is not valid JSON #87

Open almosnow opened 3 weeks ago

almosnow commented 3 weeks ago

Calls to https://zrdbegawce.execute-api.us-east-1.amazonaws.com/prod/counts return errors like the one in the subject.

That string is base64 encoded so maybe a missing atob(...) call somewhere?

lukepereira commented 3 weeks ago

the RTK client already has a line for parsing this. https://github.com/serratus-bio/open-virome/blob/ab7e2c0d451c2fced2af32b72e2669ece5f1113d/frontend/src/api/client.ts#L23

Can remove the error message from console if it's too noisy. I couldn't figure out why api-gateway was base64 encoding the request sometimes.

Also, we should try using that client instead of using fetch since it will handle UI caching, retries, etc

ababaian commented 2 weeks ago

Is there something actionable here?