mirror of
https://github.com/tr4nt0r/python-xbox.git
synced 2026-04-25 07:45:58 +03:00
[PR #93] [CLOSED] fix(people): correct friends list API endpoints and contract version #93
Labels
No labels
👻 bug
🐣 good first issue
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/python-xbox#93
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/tr4nt0r/python-xbox/pull/93
Author: @misiektoja
Created: 2/7/2026
Status: ❌ Closed
Base:
main← Head:friends-list-fix📝 Commits (3)
4825142fix(people): correct friends list API endpoints and contract version70a6f8dfix(people): revert get_friends_own URL to maintain established behavior6243bc5test(people): add compatibility test for contract v5 response format📊 Changes
4 files changed (+127 additions, -23 deletions)
View changed files
📝
src/pythonxbox/api/provider/people/__init__.py(+24 -9)📝
src/pythonxbox/api/provider/people/models.py(+14 -14)➕
tests/data/responses/people_friends_by_xuid_v5.json(+74 -0)📝
tests/test_people.py(+15 -0)📄 Description
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: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/...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:
get_friends_ownget_friends_by_xuidI noticed contract v7 was introduced in PR #1 to provide additional relationship fields (
isFriend,canBeFriendedetc.). 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:
get_friends_ownget_friends_by_xuid🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.