jedi-gg / swgoh.gg.public

SWGOH.GG Issues
https://swgoh.gg
42 stars 12 forks source link

Guild API link shows ship powers that are lower than in-game #260

Closed guruzim closed 6 years ago

guruzim commented 6 years ago

https://swgoh.gg/api/guilds/1476/units/

When i sum all of the ship power reported on this link for user ZIM and compare with the ship power on the site, the site is correct but the API is consistently lower. It does not seem to be a processing lag, it has been lower for days.

The issue seems to be only with combat_type = 2 ships data, character GP looks reasonable.

DennisBecker commented 6 years ago

My Current example from today with my Profile from https://swgoh.gg/u/radhad/:

swgoh.gg Website

Galactic Power: 2,279,075 Galactic Power (Characters): 1,365,015 Galactic Power (Ships): 914,060

swgoh.gg API

Galactic Power 2,241,007 Galactic Power (Characters) 1,365,015 Galactic Power (Ships) 875,992

I have build the sum of power of all characters and ships.

scobenes commented 6 years ago

Did you make any changes to your ships during the day when you were testing this? the guild API AFAIK has like a day cache on it, so it would be old data, but should eventually converge. The website gets its cache cleared when we sync, but we don't want to clear the cache every time a guild member updates their info. As that endpoint is pretty intensive.

With our new system updates we may be able to reduce the cache, but I am not sure if we would have this endpoint be 100% up to date always.

If this doesn't describe your situation let me know and I can maybe dig deeper, but thats what this feels like.

Link to upcoming changes I was talking about: https://www.reddit.com/r/SWGalaxyOfHeroes/comments/8jhb3m/swgohgg_upcoming_changes/

DennisBecker commented 6 years ago

Here is my current galactic power visible on the swgoh.gg website:

screen shot 2018-05-16 at 08 17 13

And here is my current galactic power calculated from the API moments ago (after requesting my profile on the website):

screen shot 2018-05-16 at 08 51 07

From the website, my profile was last updated at 2018-05-15T17:26:12Z

Are there different caches for swgoh.gg website and API? Why are character GP same but ships not?

DennisBecker commented 6 years ago

[EDIT] nevermind, this was my fault. Ignore this post

[ORIGINAL] Another thing is, if you check the profile of https://swgoh.gg/u/paultailor/collection/235/r2-d2/ you can see that R2D2 is G11 while the API today says that R2D2 is G10. It looks like completely different caching times for website & API so that every user gets wrong data in the end result.

guruzim commented 6 years ago

to answer your question, it isn't due to changes made to ships. My guild's GP when summing all power levels from the API is always much lower than the current GP. It used to be almost dead on. There was a point in March where it diverged.

Summing the combat type for characters gets a value within a few hundred. Summing ships is always off by 50k gp per player in my guild. I can run a spreadsheet for you if it would help.

DennisBecker commented 6 years ago

I can check this daily with a script I have build. The character GP value is always the same between API and website - only ships GP differs a lot.

mir0810 commented 6 years ago

I confirm I noticed that since a few weeks back as well. Ship gp on Website is accurate after sync but api ship gp is off ... maybe even by a constant factor for each ship, but didn’t dig deep enough yet ...

mir0810 commented 6 years ago

Bump. Still same issue

Benjact commented 6 years ago

In fact it goes beyond, because each ship hasn't the gp of the game #316