twreporter / twreporter-npm-packages

https://twreporter-components-storybook.vercel.app/?path=/story/hello-world-introduction--page
MIT License
5 stars 12 forks source link

Post fetching with null categories #88

Open babygoat opened 4 years ago

babygoat commented 4 years ago

Per error reporting report

twreporter-redux occasionally dispatchActions with following request

https://go-api.twreporter.org/v1/posts?where={"categories":{"in":[null]}}&limit=10&offset=0
nickhsine commented 4 years ago

Problem Description

  1. Someone visit https://www.twreporter.org/category/intl .
  2. category/intl is not defined in our routes, so we cannot find the list id.
  3. https://go-api.twreporter.org/v1/posts?where={"categories":{"in":[null]}}&limit=10&offset=0 generated by frontend:redux, and sent to backend:go-api server.
  4. backend:go-api can not handle the request well, return 500 status code.
  5. frontend:twreporter-react reports it to error reporting.

Solution

Fix backend:go-api. Make backend:go-api handle that request well, return 200 status code and empty records.

nickhsine commented 4 years ago

Fix this error by https://github.com/twreporter/go-api/commit/66aeaeeec1e8a7ea6ba356c2ed7d1d81517be553

babygoat commented 4 years ago

I still see this issue now and then and will result in bulk error message hundreds of time each day. This still need further investigation why would the error persists. Also, the fix patch uses the incorrect package which should be github.com/pkg/errors not standard "errors" package, I will come up the update later. The time charts reflects that the pattern of error reporting issue on go-api has similar pattern on twreporter-react. So this might be related.