Stop guessing which board a request means
There was a shim reading a missing game as lemonade. It existed because the deployed lemonade bundle predated this service and posted no game at all, and copies of it were sitting in browsers -- removing it while that was true would have sent every score from a cached page nowhere. It is no longer true. The lemonade bundle has been rebuilt and is what the site actually serves, checked by reading the asset the public URL points at rather than the one the origin holds: there is a CDN in between and those are two different claims. Both bundles name their game on read and on write. So the guess goes. It was right while there was something to guess for and is wrong now: filing an unlabelled score under whichever game happens to be first is the kind of default that stays invisible until it is wrong, and the caller always knows which game it is. A request that does not say is refused, and the refusal lists the boards there are rather than only saying no. One test, over the shapes a missing game actually arrives in -- undefined, null, empty string, and the falsy values that are not strings at all. 19 tests.
This commit is contained in:
@@ -79,14 +79,17 @@ accounts has ever been able to offer.
|
||||
Every entry in a post is validated before any of them is written: a party that
|
||||
half-posts is worse than one that does not post at all.
|
||||
|
||||
### The missing-game shim
|
||||
### Every request names its game
|
||||
|
||||
A request with no `game` is treated as `lemonade`. That is a compatibility
|
||||
shim, not a default worth keeping — the deployed lemonade bundle posts no game
|
||||
at all, because when it was built there was only one board, and copies of it
|
||||
are sitting in people's browsers. It can go once that bundle has been rebuilt
|
||||
and redeployed, and not before, or every score set from a cached page lands
|
||||
nowhere.
|
||||
There is no default. A request that does not say which board it wants is
|
||||
refused with the list of boards there are.
|
||||
|
||||
There was briefly a shim that read a missing `game` as `lemonade`, because the
|
||||
deployed lemonade bundle predated this service and posted no game at all. It
|
||||
was removed once that bundle had been rebuilt and was what the site served —
|
||||
verified by reading the asset the public URL actually points at, not the one
|
||||
the origin holds, because there is a CDN in between and the two are not the
|
||||
same claim.
|
||||
|
||||
## The migration
|
||||
|
||||
|
||||
Reference in New Issue
Block a user