smogon / pokemon-showdown-client

The client for Pokémon Showdown
http://pokemonshowdown.com
GNU Affero General Public License v3.0
562 stars 789 forks source link

Fixed a case of endless loop #2285

Closed swordfishtr closed 1 month ago

swordfishtr commented 1 month ago

It was possible to freeze the tab by importing a team/set containing ] with no | after.

(only if the whole import is 1 line or 2 lines with the 2nd one being blank - this leads to the importer using Storage.unpackTeam() which is intended functionality.)

I took care to not conflict with #2222 . hopefully we can discuss rewriting the packed team format after these prs are resolved ...

credit for finding this bug: https://github.com/smogon/pokemon-showdown-client/pull/2283#issuecomment-2370371178

Slayer95 commented 1 month ago

rewriting the packed team format after these prs are resolved ...

Team packing originally seemed like a great idea, since teams should be able to be efficiently stored in localStorage to prevent browser-initiated cleanups (some people have thousands of teams.)

However, newer gens have released all sorts of new mechanics that mess with teams formats. Additionally, there has been some developments in data compression, such as:

You can probably bring this discussion to the Smogon Development Discord server.