maproulette / maproulette/maproulette-backend

Bounding boxes added to priority rules through API get altered.

Open
#886 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
53
Forks
39
Avg merge
1d 17h
Merged PRs (30d)
12

Description

When I use the API to create or update a challenge that has a bounding box highPriorityRule, the first value (x_min) gets munged.

If add this json to the high priority rule:
{"type": "bounds", "operator": "contains", "value": "-98.805051,29.2562939,-98.023766,29.777227"},

then the resulting high priority rule set in the challenge looks like this:
Screen Shot 2021-03-10 at 12 42 53 PM

The full text in the value box is: "805051,29.2562939,-98.023766,29.777227"

The first value seems to be getting altered from what was passed in as I would expect it to be
"-98.805051,29.2562939,-98.023766,29.777227"

From the code I gathered that it thinks that the "value" string is a two part string separated by a "."
So I tried adding a garbage string to my value...
{"type": "bounds", "operator": "contains", "value": "bbox.-98.805051,29.2562939,-98.023766,29.777227"},
And that worked!

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 by tracing the API path for creating or updating a challenge and handling a bounds highPriorityRule value. Reproduce the issue with the two JSON examples, then inspect where the value is split or parsed. Done means the negative x_min is preserved for both create and update requests, with regression coverage if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.