KingdomCreator icon indicating copy to clipboard operation
KingdomCreator copied to clipboard

Query parameters aren't cleaned up

Open davidtorosyan opened this issue 4 years ago • 1 comments

I've noticed that while the query parameters in the URL update to match the randomized cards, they don't clean up previous entries.

For example, start with this URL: https://dominionrandomizer.com/?supply=castles,chariotrace,expand,haven,merchantship,moneylender,patricianemporium,pawn,shantytown,treasuremap&landmarks=basilica&colonies=1&events=conquest

Then uncheck prosperity and hit randomize. The colonies card will disappear, but the colonies=1 term will remain the query parameter.

The same is true for events and landmarks (and other similar cards). If the new set of cards don't include any from that type, the old cards will still appear in the URL.

As an extreme example, after hitting randomize a few times I end up with this: https://dominionrandomizer.com/?supply=bazaar,cutpurse,encampmentplunder,festival,flagbearer,loan,moat,priest,spices,tactician&landmarks=basilica,baths&colonies=1&events=ritual&projects=piazza

This has 2 landmarks, 1 ritual, and 1 project.

The impact of this bug is that sharing the URL of a randomized page might not produce the same results on the receiving side.

davidtorosyan avatar Apr 13 '20 07:04 davidtorosyan

Good find!

Thanks for the thorough description. This should be fairly straightforward to fix. Hoping to get to it this weekend or next.

blakevanlan avatar Apr 17 '20 21:04 blakevanlan

I worked on it see comment on Issues #128

gillesgros avatar Feb 12 '23 21:02 gillesgros

deployed

gillesgros avatar May 04 '23 08:05 gillesgros