doshidak / showdex

Pokémon Showdown extension that harnesses the power of parabolic calculus to strategically extract your opponents' Elo.
GNU Affero General Public License v3.0
104 stars 18 forks source link

fix race condition w/ Teambuilder sets when initializing a Pokémon #116

Closed doshidak closed 1 year ago

doshidak commented 1 year ago

When first initializing a Pokémon, there's a race condition that will default to ignoring the Teambuilder sets if not converted already. This exists due to the performance optimization I put in in v1.1.2 that only converts the sets from the Teambuilder once per battle.

Depending on how fast the battle loads, the Teambuilder sets can occasionally not be converted at all, so those options aren't available in the dropdown. It also appears that the race condition is eliminated when refreshing the page mid-battle as the Teambuilder sets always appear in that instance (i.e., the race condition only exists when the battle tab is opened while Showdown is open).