tzhf / chatguessr

A Twitch chatbot for GeoGuessr.
https://chatguessr.com
MIT License
39 stars 12 forks source link

Improve migration of electron-store stats to SQLite #5

Closed ReAnnannanna closed 2 years ago

ReAnnannanna commented 2 years ago

Migrations currently don't account that well for existing user stats. I tried to combine the DB and electron-store stats in legacyStoreFacade.js, but it's not correct in some cases, for example the number of perfects should be summed for each user from the DB and the JSON store instead of taking the highest value.

The best way to do it would be to have a SQLite table with all the legacy stats for each user. This can then be used in queries for !me and !best.

e; We are shelving this for now. If some users really don't want to lose their stats we can look into it but likely people won't mind so much.