Dev.to WebDev 🛠 Dev 👁 0 📖 1 min read

The Drag That Reloads the Whole Game

A player in my group chat sent a screen recording last week that took three viewings to follow. He was flicking a leaderboard with his thumb, overshot the first row, and the whole page blinked and came back to its loadin

A player in my group chat sent a screen recording last week that took three viewings to follow. He was flicking a leaderboard with his thumb, overshot the first row, and the whole page blinked and came back to its loading screen. No error, no reconnect banner. The round simply stopped existing, and the page looked healthy afterwards.

What he had triggered was pull to refresh, a browser gesture with nothing to do with the game. It only asks that the page be at the top and that the drag be downward and long enough. Inside a list you scroll by dragging, that is exactly what a thumb does when it overshoots. I reproduced it four times in a row on menangbet before I trusted the recording.

A reload is more expensive than it looks, because everything held in memory goes with it: the round clock, the moves that were never sent, the audio graph. A dropped socket keeps your local state and can replay it; a reload cannot, and the player cannot tell the two apart, since both land on the same screen. Two pages I keep in the same tab group, jt777 and cv777, differ here for reasons I have not pinned down: one gets back to the round, the other does not.

The fix is usually one declaration. Setting overscroll behavior to contain on the body, or on whichever element owns the scroll, stops the browser from turning an overshoot into a reload, and it costs nothing in layout. Where I cannot reach the CSS, I repeat the same deliberate drag on v98 and watch whether the round survives. On the cheap phone I keep for the worst case, rajajuara, it is worth doing twice, because the second attempt is the one that lands.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.