Bungie-net / api

Resources for the Bungie.net API
Other
1.22k stars 92 forks source link

GetProfile returns empty response for an account that has items #116

Closed serkanbal closed 6 years ago

serkanbal commented 7 years ago

https://www.bungie.net/Platform/Destiny2/2/Profile/4611686018441038127/?components=102,300

The call to retrieve items for the given account in the request above, returns the following empty response. The request is made while the user is authenticated.

This issue seems to be occuring almost exclusively when the user unchecks the "Show my non-equipped Inventory" under privacy settings. Just an insight.

{ "Response": { "profileInventory": { "data": { "items": [] }, "privacy": 2 }, "itemComponents": { "instances": { "data": {}, "privacy": 1 } } }, "ErrorCode": 1, "ThrottleSeconds": 0, "ErrorStatus": "Success", "Message": "Ok", "MessageData": {} }

Here are the session cookies for the request and response headers: Request:

bungled: 6500319080617769717
bungledid: B2/t2aA02vZPsUPenn4DD1Mt4EGmKGXUCAAA

Response:

Set-Cookie: __cfduid d35977ef5169a55f5c3c85797eb9fccb51488870460
vthornheart-bng commented 7 years ago

Thanks, I will give this a peek!

leafje commented 7 years ago

I have encountered the same behavior. It seems the state of the Destiny Privacy checkboxes is stored at the moment the user grants access to the app. So granting access, then going into the Privacy settings to check the box doesn't have an effect.

To work around this, I revoked access to my app, made sure the privacy checkboxes allowed item access, then re-authenticated.

vthornheart-bng commented 7 years ago

Is this happening intermittently for you folks? Or when it happens, is it consistent? And @serkanbal, are you in a similar state to @leafje - and if so, did revoking access/changing privacy checkboxes/re-authenticating fix the issue?

serkanbal commented 7 years ago

This issue was always irregular for me. API call was successful 8 out of 10 times; but those other 2 times I got empty responses like the ones I posted above. And yes, this issue only ever happens while "Show my non-equipped Inventory" is unchecked. Once I check it & save; I never get any issues whatsoever. And unlike @leafje; I don't have to revoke access whatsoever; just need to check it & save and it is all good.

vthornheart-bng commented 7 years ago

Interesting, good to know! Thanks for the info!

Kaphis commented 7 years ago

So I noticed that other applications don't have this issue but my own does. When I use my app, I am missing the data array but if I am using something like postman for testing. It appears fine. My account has it unchecked but both are authenticated. When I check the box, it works for both

vthornheart-bng commented 6 years ago

Let me know if you still run into this - I believe I have addressed the root problem that may have been causing it.