Bungie-net / api

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

clanName and clanTag are not populated in Destiny.HistoricalStats.DestinyPlayer objects in PGCRs #437

Open zcrisler opened 6 years ago

zcrisler commented 6 years ago

I'm using the Destiny2.GetPostGameCarnageReport endpoint to retrieve PGCRs for members in my clan; however, the returned Destiny.HistoricalStats.DestinyPostGameCarnageReportData object does not include clanTag or clanName as part of the Destiny.HistoricalStats.DestinyPlayer object included in an Destiny.HistoricalStats.DestinyPostGameCarnageReportEntry. This makes aggregating activities for clan members while they're in the clan difficult (if not impossible) without externally tracking clan membership.

floatingatoll commented 6 years ago

To ask an interesting question here around expectations:

If someone changes clan, do you expect a historical PGCR from prior to their change to include their old clan or their new clan?

zcrisler commented 6 years ago

I would expect it to include the clan information from the clan they were in at the time the activity was completed. So old.

A related question: what is the behavior in the event someone changes their gamer tag? I assume membershipId would remain the same although prior games would report the old gamer tag.

vthornheart-bng commented 6 years ago

Ah, unfortunately at the moment we can't get historically correct clan data: though I'd like to see that come to pass in the future! I'll add it as an enhancement request.

zcrisler commented 6 years ago

@vthornheart-bng Do you mean (a) you cannot record accurate clan information as part of new PGCRs or (b) you cannot populate previous PGCRs with historically accurate clan information? Or both?

I'm much more concerned that (a) happens so that going forward clan data is reported in PGCRs. (b) is understandably more challenging, and I'm not losing sleep over it, though I would like to see it happen.

vthornheart-bng commented 6 years ago

Oh... you know, actually I took a minute to do a little digging and the situation might not be as dire as I'd said before.

I'll have to keep you posted on this, but it may actually be possible to get you (a) at some point even if (b) isn't possible. We'll need to do a bit of work though, so I'm going to keep it as an enhancement request.

zcrisler commented 6 years ago

Thanks @vthornheart-bng! Sounds hopeful.

Also, I'm not sure how you prioritize enhancements versus defects, but I think this could also be classified as a defect since the API documentation already includes clanTag and clanName.

vthornheart-bng commented 6 years ago

True! This is one of those places where we reused a contract class without actually having a good way of populating that value with the consistency that we would like/ought to have.

So here's the situation as far as I'm seeing it - it looks like we should be able to get the Clan's ID, but it won't have any knowledge of what the name or tag of that clan was at that point in time. However, the nice thing is that the Clan ID is immutable: so even if their name/tag changes, you'll at least have a consistent ID to work with once we expose these. When we get around to this, I'd likely want to pass you the ID as well as the current name and tag of that clan (which is the best we'll be able to give you in the latter case). Just writing it down here for reference when we come back to this.

floatingatoll commented 6 years ago

Are clan IDs unique across all platforms or only per-platform?

If a clan is deactivated (is that even possible?), will the PGCR return a blank clan ID, a valid clan ID that can be looked up to the last known values, or a formerly valid clan ID that can be presumed deleted when it can’t be looked up?

On Mar 6, 2018, at 14:22, Vendal Thornheart notifications@github.com wrote:

True! This is one of those places where we reused a contract class without actually having a good way of populating that value with the consistency that we would like/ought to have.

So here's the situation as far as I'm seeing it - it looks like we should be able to get the Clan's ID, but it won't have any knowledge of what the name or tag of that clan was at that point in time. However, the nice thing is that the Clan ID is immutable: so even if their name/tag changes, you'll at least have a consistent ID to work with once we expose these. When we get around to this, I'd likely want to pass you the ID as well as the current name and tag of that clan (which is the best we'll be able to give you in the latter case). Just writing it down here for reference when we come back to this.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

vthornheart-bng commented 6 years ago

Aye, they are unique across all platforms! In fact, a given Clan can support people from multiple platforms. For instance, the test clan I'm in has people from PSN and Blizzard in it: https://www.bungie.net/en/ClanV2/Chat?groupId=1541858

Indeed, clan deactivation is possible: I'll have to decide what we return when the time comes, as we'd still have the Clan ID in that case but it wouldn't be pointing at an active clan. This could still be useful for aggregation purposes, even if the clan was disbanded. But it also does bring up interesting questions about why the Clan was disbanded: did they want to continue to have their stats be aggregated? (we don't have a way of knowing that - at least not currently, and I don't particularly want to get into the business of asking someone why they're disbanding a clan) Could we realistically even prevent that? (no if we'd already been returning the info. We could prevent future PGCR scrapers from getting it, but we can't undo the fact that older scrapers would have the data. And the act of putting yourself in a Clan is also the act of explicitly declaring a publicly accessible relationship between yourself and these other users, one whose knowledge once joined isn't something we can undo)

Lots of detail questions we'll have to think through when the time comes: but this isn't something I can cram into any of the upcoming sprints, so it'll have a little time to sit and we'll have time to think about it before/if it comes into existence.

floatingatoll commented 6 years ago

No to "Could you realistically prevent it?" for sure :)

On Tue, Mar 6, 2018 at 2:53 PM, Vendal Thornheart notifications@github.com wrote:

Aye, they are unique across all platforms! In fact, a given Clan can support people from multiple platforms. For instance, the test clan I'm in has people from PSN and Blizzard in it: https://www.bungie.net/en/ ClanV2/Chat?groupId=1541858

Indeed, clan deactivation is possible: I'll have to decide what we return when the time comes, as we'd still have the Clan ID in that case but it wouldn't be pointing at an active clan. This could still be useful for aggregation purposes, even if the clan was disbanded. But it also does bring up interesting questions about why the Clan was disbanded: did they want to continue to have their stats be aggregated? (we don't have a way of knowing that - at least not currently, and I don't particularly want to get into the business of asking someone why they're disbanding a clan) Could we realistically even prevent that? (no if we'd already been returning the info. We could prevent future PGCR scrapers from getting it, but we can't undo the fact that older scrapers would have the data. And the act of putting yourself in a Clan is also the act of explicitly declaring a publicly accessible relationship between yourself and these other users, one whose knowledge once joined isn't something we can undo)

Lots of detail questions we'll have to think through when the time comes: but this isn't something I can cram into any of the upcoming sprints, so it'll have a little time to sit and we'll have time to think about it before/if it comes into existence.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Bungie-net/api/issues/437#issuecomment-370958451, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFqDKty06Oh3cLsFBiz2zmGoZ1qcpQgks5tbxNhgaJpZM4SbF07 .

vthornheart-bng commented 6 years ago

Aye, for sure :D

zcrisler commented 6 years ago

Hmmm... Sounds like this could be cumbersome. Is there another way one could go about aggregating PGCRs across a clan? Is there any way to get historical clan membership stats? What about something like a previousUserMemberMap in a GroupsV2.GroupResponse that includes leaveDate as well as joinDate? Depending on the time period in question (and the authenticated user), I'd know whose PGCRs to query and how to filter them.

vthornheart-bng commented 6 years ago

I like the idea of a "GetActivityHistoryForClan" endpoint, but unfortunately that'll require more significant changes. I can't promise that we can realistically provide that anytime soon, but I think it's a solid idea and one I would like to see come to pass even if it's in the more distant future.

Due to the way that the clans infrastructure is set up, I think the prior history data will unfortunately not be possible for us to expose: but that is another situation where I think that would be great for the distant future wishlist!