Skip to content

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
@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.35%. Comparing base (132b2be) to head (6243bc5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #93      +/-   ##
==========================================
+ Coverage   88.34%   88.35%   +0.01%     
==========================================
  Files          54       54              
  Lines        2857     2860       +3     
==========================================
+ Hits         2524     2527       +3     
  Misses        333      333              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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