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

[GOT-64] Avoid returning 404 if read-query statement returns 0 rows #311

Open
jsign opened this issue Sep 30, 2022 · 1 comment
Open

[GOT-64] Avoid returning 404 if read-query statement returns 0 rows #311

jsign opened this issue Sep 30, 2022 · 1 comment
Labels
help wanted Extra attention is needed linear Sync issue with linear question Further information is requested

Comments

@jsign
Copy link
Contributor

jsign commented Sep 30, 2022

Some days ago, I was looking at error level logs in the validator, and I noticed a couple of "Rows not found" messages.

These came from /query API calls with read queries that result in 0 rows. It wasn't reasonable to log an error level message in this case since it's fine that users will make read queries with empty results, so the log line was removed to avoid noise in logs.

Apart from that, while chatting with @brunocalza about this case, we have the sensation that the API shouldn't be returning StatusNotFound either see here.

If we receive a read-query that returns an empty result, it'd seem OK to return a 200 status code with an empty result. Technically speaking, the read-query executed fine, and the correct result is empty. That's maybe the intention of the read-query: checking if the result is empty. If that was the case, the user is getting a 404 status code which seems odd.

We don't remember if this was done on purpose, so maybe has a good reason. Also, this is a breaking change since some people might be relying on the 404 behavior today.

We're surfacing this situation here for further discussion since some other API changes are coming so it's worth bundling it with them.

cc @sanderpick @carsonfarmer @joewagner @awmuncy @dtbuchholz

GOT-64

@jsign jsign added help wanted Extra attention is needed question Further information is requested labels Sep 30, 2022
@jsign jsign moved this to 🆕 New in go-tableland backlog Sep 30, 2022
@brunocalza brunocalza added the linear Sync issue with linear label Mar 23, 2023
@brunocalza brunocalza changed the title Avoid returning 404 if read-query statement returns 0 rows [GOT-64] Avoid returning 404 if read-query statement returns 0 rows Mar 23, 2023
@sanderpick
Copy link
Member

@brunocalza can you go through these triage issues and either close them if we're not going to do them or move them to backlog?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed linear Sync issue with linear question Further information is requested
Projects
No open projects
Status: 🆕 New
Development

No branches or pull requests

3 participants