KnutZuidema / golio

League of Legends, Legends of Runeterra and Valorant API client library for Go
MIT License
73 stars 29 forks source link

If you call GetChampions() after calling GetChampion(championName), you only see a limited number of results #24

Closed algorithme closed 4 years ago

algorithme commented 4 years ago

If you call GetChampion("Ashe") and then you call GetChampions(), you will only receive a list containing Ashe.

I'm not sure this is expected and I wonder if the cache used for GetChampion shouldn't be different.

IMHO, I would first check in GetChampions Cache if Ashe is available, then in GetChampion Cache and when I get the result I would only store it in GetChampion Cache.

If you want I can fix it for you ?

KnutZuidema commented 4 years ago

You are completely right, that's a bug. However I would rather not introduce another, separate cache just for GetChampion. I think atomically toggling a flag when GetChampions has been called would be better. If you want, you can open a PR with a fix, otherwise I'll do so, soon.