hotosm / galaxy-api

Backend to fetch data from Underpass
https://galaxy-api.hotosm.org/latest/redoc
GNU Affero General Public License v3.0
14 stars 5 forks source link

Inconsistency in users via /osm-users/ids and /data-quality/user-reports #119

Closed d-rita closed 2 years ago

d-rita commented 2 years ago

When querying the /data-quality/user-reports endpoint with this:

{
  "fromTimestamp": "2021-12-16T00:30:00.000",
  "toTimestamp": "2021-12-17T00:15:00.000",
  "osmUsernames": [
    "Fadlilaa IRM-ED","Bert Araali"
  ],
  "issueTypes": [
    "badgeom"
  ],
  "outputType": "geojson"
}

I get a file result with both the users' data quality issues.

On the user reports page on the galaxy UI, the procedure is as follows:

  1. User enters the osm usernames, start and end dates, and/or mapathon hashtags.
  2. An API request is made to the /osm-users/ids endpoint with the osm usernames entered and dates.
  3. With the returned ids for each user, an API request is made to /osm-users/statistics for each user to return their respective stats. As well as another API request to /data-quality/user-reports to retrieve their data quality reports in either CSV or JSON.

The issue is when using that same sample request info with the specified dates whilst following the steps outlined in the frontend procedure, only one user id is returned, and hence only one user's report is displayed on the galaxy UI.

This is not consistent with the information returned when hitting the /data-quality/user-reports endpoint which shows the results for both users.

d-rita commented 2 years ago

cc: @itskshitiz321

kshitijrajsharma commented 2 years ago

Thanks @d-rita for the flag ! I have Updated fix on production , Can you review it ?

d-rita commented 2 years ago

This works as expected with the new sample request. Thanks, @itskshitiz321