parse-dashboard icon indicating copy to clipboard operation
parse-dashboard copied to clipboard

API Console - Multiple Query Parameters break console

Open shelbykauth opened this issue 6 years ago • 1 comments

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Dashboard!

  • [x] You're running version >=1.0.23 of Parse Dashboard. (1.2.0)

  • [x] You're running version >=2.3.2 of Parse Server. (2.8.4)

  • [x] You've searched through existing issues. Chances are that your issue has been reported or resolved before.

Environment Setup

Parse API is running on top of MongoDB.

Steps to reproduce

1- Go To API Console 2- Ensure that single parameters are working such as these: screen shot 2019-02-19 at 3 18 41 pm screen shot 2019-02-19 at 3 18 26 pm 3- Try Multiple Parameters and press send query screen shot 2019-02-19 at 3 32 10 pm

4- Watch in horror as the page freezes, you're unable to refresh the page (close tab and open a new one and navigate back to reset), and if your database is on the same machine as you're accessing the dashboard on, listen in horror as your usually-silent fans spin up and start making some noise. Fun stuff.

Anyways, a little digging shows that the reason for this is that it parses it into an incorrect cUrl request.

curl -X GET \
-H "X-Parse-Application-Id: ****************************************" \
-H "X-Parse-REST-API-Key: ******************" \
-G \
--data-urlencode "limit=5,
skip=3" \
https://dev-api.****************.com/1/classes/Event

I'm not sure how to make the dashboard encode this correctly, which I'm assuming would be something like this...

curl -X GET \
-H "X-Parse-Application-Id: ****************************************" \
-H "X-Parse-REST-API-Key: ******************" \
-G \
--data-urlencode "limit=5" \
--data-urlencode "skip=3" \
https://dev-api.****************.com/1/classes/Event

And even if the dashboard cannot encode this correctly, there needs to be some sort of safety net for when there is an error like this.

So all in all, two bugs to fix

  • No Safety Net for badly formed cUrls
  • ~~Attempting to submit multiple parameters results in badly formed cUrls.~~
  • No indication of the right way to submit multiple parameters

shelbykauth avatar Feb 19 '19 20:02 shelbykauth

Found a workaround...

Instead of this...

limit=5
skip=3

do this...

limit=5&skip=3

This is annoying as there is little indication to this being the answer, and I can't easily experiment to get to this solution, as the page freezes if I put it in wrong (I've been dealing with this issue for the past couple months, finding workarounds by just not using the dashboard...).

Also, the reason I needed to use this is trying to put in a where clause and a limit at the same time so I can test my where clauses and the page doesn't lag due to having >1k results appearing on the page.

shelbykauth avatar Feb 20 '19 17:02 shelbykauth