Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Page number set as null for the related images endpoint #931

Closed
1 task done
chrisbartoloburlo opened this issue Sep 20, 2022 · 10 comments
Closed
1 task done

Page number set as null for the related images endpoint #931

chrisbartoloburlo opened this issue Sep 20, 2022 · 10 comments
Labels
🕹 aspect: interface Concerns end-users' experience with the software 🛠 goal: fix Bug fix 🟧 priority: high Stalls work on the project or its dependents 🔧 tech: django Requires familiarity with Django 🐍 tech: python Requires familiarity with Python

Comments

@chrisbartoloburlo
Copy link

Description

Wrong page number when requesting related images using the images/{identifier}/related/ endpoint.

Reproduction

  1. just up
  2. Run curl -v \ --request GET \ --url 'http://localhost:50280/v1/images/5f9ed3ba-b762-459e-9165-094470dc4805/related/?format=json'
  3. Notice the page parameter set as null: {"result_count":767,"page_count":1,"page_size":10,"page":null,"results":[...]}

Resolution

  • 🙋 I would be interested in resolving this bug.
@chrisbartoloburlo chrisbartoloburlo added 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work 🛠 goal: fix Bug fix labels Sep 20, 2022
@krysal
Copy link
Member

krysal commented Sep 20, 2022

I get page:1 as the result of that request @chrisbartoloburlo. Did you try it in a fresh environment? After doing just recreate?

@chrisbartoloburlo
Copy link
Author

chrisbartoloburlo commented Sep 20, 2022

I executed just recreate and tried the request once again. However, I got the same output with "page"=1.
The same thing happens when I send the following request: curl -X GET --url 'https://api.openverse.engineering/v1/images/5f9ed3ba-b762-459e-9165-094470dc4805/related/?format=json'

@AetherUnbound AetherUnbound added 🟧 priority: high Stalls work on the project or its dependents 🕹 aspect: interface Concerns end-users' experience with the software 🐍 tech: python Requires familiarity with Python 🔧 tech: django Requires familiarity with Django and removed 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Sep 20, 2022
@AetherUnbound
Copy link
Contributor

AetherUnbound commented Sep 20, 2022

I've set the priority of this issue to "high" because it seems like it may be a bug in the API that should be addressed. If this proves difficult to replicate or ends up being an issue that's smaller in scope, we can reduce the priority. Thank you again for raising this Christian!

@AetherUnbound
Copy link
Contributor

I also see "page": 1 when I run curl -s --request GET \ --url 'http://localhost:50280/v1/images/5f9ed3ba-b762-459e-9165-094470dc4805/related/?format=json' | jq ".page". @WordPress/openverse-api is anyone else able to reproduce what @chrisbartoloburlo is seeing?

@chrisbartoloburlo
Copy link
Author

@AetherUnbound do you also get "page":1 when you run curl -s --request GET \ --url 'https://api.openverse.engineering/v1/images/5f9ed3ba-b762-459e-9165-094470dc4805/related/?format=json' | jq ".page"?

@AetherUnbound
Copy link
Contributor

Woah! Great find Christian! No, I am also getting null on that one 😮 This is the case in both staging and prod:

@chrisbartoloburlo if you run git checkout main && git pull then just recreate, do you see the same behavior locally?

@AetherUnbound
Copy link
Contributor

I suspect that this was addressed in #868, which is merged and slated for release this week. We can see if this issue is addressed in production after the deployment.

@AetherUnbound
Copy link
Contributor

Sorry for the multiple posts, I ran git checkout v2.5.12 && just build && just up then ran the following:

$ curl -s --request GET \ --url 'http://localhost:50280/v1/images/5f9ed3ba-b762-459e-9165-094470dc4805/related/?format=json' | jq ".page"
null

So this has been addressed as of v2.5.13, which we'll be deploying this week!

@AetherUnbound
Copy link
Contributor

API v2.5.13 has been deployed and the page is now showing up correctly! I'll go ahead and close this issue, thanks again for raising it Christian 😄

@krysal
Copy link
Member

krysal commented Sep 21, 2022

Great find @chrisbartoloburlo! Thanks for communicating this :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🕹 aspect: interface Concerns end-users' experience with the software 🛠 goal: fix Bug fix 🟧 priority: high Stalls work on the project or its dependents 🔧 tech: django Requires familiarity with Django 🐍 tech: python Requires familiarity with Python
Projects
None yet
Development

No branches or pull requests

3 participants