Skip to content

Conversation

@drisc
Copy link
Contributor

@drisc drisc commented Dec 18, 2024

This PR adds an endpoint to fetch the current set request list of a user along with their total request count and the amount of points they need to unlock their next request.

Copy link
Member

@wescopeland wescopeland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @drisc!

Thanks for opening this PR! I've briefly scanned over the implementation and left one comment for you to chew on 🙂

Once it's resolved, I'm happy to do a deeper dive into the patchset implementation details.

In the meantime, I will be temporarily moving this PR to draft. From our latest contributing requirements, any API changes require a sister PR in api-docs. An example of a good one can be found at RetroAchievements/api-docs#68!

Once an api-docs PR is opened, please feel free to move this PR out of draft! Thanks for your understanding 🙏

@wescopeland wescopeland marked this pull request as draft December 18, 2024 02:12
@drisc drisc marked this pull request as ready for review December 18, 2024 02:35
@Jamiras
Copy link
Member

Jamiras commented Dec 19, 2024

Users with inflated requests due to April Fools shenanigans are reporting "TotalRequests" as their supposed limit, not the actual number of requests they have.
image

...,"TotalRequests":13,"PointsForNext":4425}

This does match their page, so I think it's probably working as designed.

->where('type', 'achievement_set_request')
->orderBy('GameData.sort_title')
->get()
->toArray();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that this is returning completed requests (i.e. the list returned when clicking on "View All User Set Requests"). It should probably only return active requests (where GameData.achievements_published = 0)

Is there any reason we'd want to expose the completed requests? If so, we might want a flag for doing so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The site page allows for viewing all past requests as well so adding a flag for it would be my vote. That way the endpoint can get a list of all a users requests if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type flag added in latest, I've also updated and added a test to check for achievements_published.

@wescopeland wescopeland merged commit 293556b into RetroAchievements:master Jan 2, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants