⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

fix(people): correct friends list API endpoints and contract version#93

Open
misiektoja wants to merge 3 commits intotr4nt0r:mainfrom
misiektoja:friends-list-fix
Open

fix(people): correct friends list API endpoints and contract version#93
misiektoja wants to merge 3 commits intotr4nt0r:mainfrom
misiektoja:friends-list-fix

Conversation

@misiektoja
Copy link

@misiektoja misiektoja commented Feb 7, 2026

Hi, I switched my project from xbox-webapi-python to python-xbox and noticed that my code for fetching the list of friends was not working anymore.

It turned out the get_friends_by_xuid() method was not working correctly:

  1. It had a broken URL path /users/me/people/xuids({xuid})/... which returns the authenticated user's info, not the target user's friends list. The correct path is /users/xuid({xuid})/people/social/...

  2. Contract version 7 returns empty results for get_friends_by_xuid(). When querying another user's friends list, contract v7 returns {"people": []} while v5 returns the actual friends list.

I compared behavior across contract versions:

Version get_friends_own get_friends_by_xuid
v3 (original xbox-webapi) OK OK
v5 OK OK
v7 OK NOT OK

I noticed contract v7 was introduced in PR #1 to provide additional relationship fields (isFriend, canBeFriended etc.). However, these fields are only returned when querying your OWN friends list - get_friends_by_xuid() returns empty with v7 when querying another user.

I implemented usage of different contract versions per method to get the best of both worlds:

Method Contract Version Reason
get_friends_own v7 Full relationship fields
get_friends_by_xuid v5 v7 returns empty for other users

@github-actions github-actions bot added the 👻 bug Something isn't working label Feb 7, 2026
@github-actions github-actions bot added the 🧪 testing Pull request that adds tests label Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👻 bug Something isn't working 🧪 testing Pull request that adds tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant