Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post fetching with null categories #88

Open
babygoat opened this issue Feb 3, 2020 · 3 comments
Open

Post fetching with null categories #88

babygoat opened this issue Feb 3, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@babygoat
Copy link
Contributor

babygoat commented Feb 3, 2020

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
Copy link
Contributor

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
Copy link
Contributor

Fix this error by twreporter/go-api@66aeaee

@babygoat babygoat reopened this Apr 23, 2020
@babygoat
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants