Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes · 4 behind · 3 other forks
A result that did not land says so and is tried again, instead of vanishing #102
Sign in to join this conversation.
new above
offline
A result the server refused or never received disappears without a word: the player finishes a match, the board does not change, and nothing on the page admits it.
postResultinsrc/client/main.ts:236readsif (response.ok)and has an emptycatch, commented "a leaderboard that cannot be reached is not a reason to stop playing" — true, and also the whole of the handling. The server answers429 slow down(the guest bucket is 200 back to back per address, which a shared network reaches),409 not yourswhen a session collides,422 bad result,413,403and500; every one of them lands in thatifand is dropped. A tab that was offline for the last round posts nothing and says nothing. For a game whose entire point past the round is the board, silently losing the round is the worst thing this page does.What done looks like
Files
src/client/main.ts,src/client/main.test.ts,src/pages/game.ts(the line under#stats),static/*.Risks
A retry loop in a game loop is how you write an accidental flood: cap it, back off, and make the test that counts attempts the one you trust. Do not invent a queue in storage — a result that could not be sent this visit is gone when the tab closes, and the page should say the true thing rather than promise otherwise. The range posts nothing and needs none of this.
Suggested: Vesper —
main.ts's host and its stub are hers.