deta / cloud-docs

old docs. visit space docs instead:
https://github.com/deta/space-docs
Creative Commons Attribution 4.0 International
178 stars 67 forks source link

Bad query results in crash #667

Closed mslourens closed 1 year ago

mslourens commented 1 year ago

When I try to query my data using a bad query, the server crashes.

Steps to reproduce:

  1. Create a nodejs app (see StackBlitz)
  2. Try to get the surveys with empty questions using the endpoint http://localhost:3102/surveys/unanswered
  3. Notice the server crashes with error Bad query

Expected behavior: I would expect the server never to crash, but to return a 500 error with the message 'Bad query'.

mikBighne98 commented 1 year ago

Delete the project key from your Deta dashboard under Project Keys tab. You should not share your project keys publicly.

mikBighne98 commented 1 year ago

Your query { 'questions.answer?': '' } is not of the right format. There is no operator after ?. That's what causing your node server to crash. Again please remove your project key from your Deta dashboard and the StackBlitz environment you have shared.

mslourens commented 1 year ago

Sorry, I thought it was just a test project, I could share it, but it will open the project up to everyone with bad intent. I removed the project key. And the issue is all mine, because my express implementation was not catching any errors, therefore it crashed. I will close this issue.