KingdomCreator
KingdomCreator copied to clipboard
Query parameters aren't cleaned up
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.
Good find!
Thanks for the thorough description. This should be fairly straightforward to fix. Hoping to get to it this weekend or next.
I worked on it see comment on Issues #128
deployed