Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gameClient.js to fix the Cookie Storm problem. #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

awes12
Copy link

@awes12 awes12 commented Jul 10, 2023

There is a classic async problem in the clickGoldenCookie function. The setTimeout just tries to repop the golden cookie in 500 ms, but it doesn't take into account that the cookie might have already been popped within that time (ex: by the autoclicker), which ends up meaning that you try to pop the cookie twice (which has a lot of bad side effects).

I fixed this by just making sure that the golden cookie hasn't been popped before popping it in the async setTimeout .

There is a classic async problem here. The setTimeout just tries to repop the golden cookie in 500 ms, but it doesn't take into account that the cookie might have already been popped within that time (by the autoclicker), which ends up meaning that you try to pop the cookie twice (which has a lot of bad side effects).

I fixed this by just making sure that the cookie hasn't been popped yet before popping it in the async function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant