parse-community / parse-community/parse-dashboard

API Console - Multiple Query Parameters break console

Open
#996 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature
Dominant language
JavaScript
Stars
3.8k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

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

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

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

  • 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the API Console code that builds and submits cURL requests, then reproduce the query using multiple parameters such as limit=5 and skip=3. Check that each parameter becomes its own --data-urlencode argument, that malformed requests cannot freeze the page, and that the UI explains the supported way to submit multiple parameters.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.