diff options
author | David Gay <david@davidgay.org> | 2021-06-05 20:46:39 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-06-05 20:46:39 -0400 |
commit | e5a37756c4dc3b27959bfb1102ac8db9c549409c (patch) | |
tree | d94fd9843446bf42db372edd83a758eb3b946cee | |
parent | b1c8a5b4c3fd7b2f9dbed88c670ee8b4d7f97e16 (diff) |
Timer: Switch to 1 minute retries after 5 errors, instead of showing an alert and stopping
-rw-r--r-- | CHANGELOG.md | 6 | ||||
-rw-r--r-- | app/javascript/controllers/timer_controller.js | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bf1ce7..82b7a06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,12 @@ All notable changes to this project will be documented in this file. of the UI boxes has been shuffled and tweaked. - These changes may have introduced undesirable consequences, especially on mobile. Please report these consequences with screenshots, and let's work together to get the game looking decent everywhere. 👍 + +### Networking +- If a "finish activity" request from the client to the server fails 5 or more times, the client will switch from + trying every second to trying every minute. This behavior replaces the error alert (popup) that used to occur. This + means that the client will continue trying to get rolling again every minute, indefinitely. So hopefully this resolves + frustrating issues with leaving the game to find that your activity was halted due to internet issues. ### Engine - Refactored some activity and combat code. diff --git a/app/javascript/controllers/timer_controller.js b/app/javascript/controllers/timer_controller.js index 30e64cc..dcf046a 100644 --- a/app/javascript/controllers/timer_controller.js +++ b/app/javascript/controllers/timer_controller.js @@ -40,14 +40,15 @@ export default class extends Controller { Rails.ajax({ type: "POST", url: controller.postUrlValue, + success: () => { + this.postFailures = 0; + }, error: () => { this.postFailures++; if (this.postFailures < 5) { setTimeout(controller.finishActivity, 1000); } else { - alert("There was an error completing your activity. If your internet connection is otherwise working," + - " please report this issue, mentioning what you were" + - " doing at the time. Check if refreshing the page resolves this issue, and mention that as well."); + setTimeout(controller.finishActivity, 60000); } }, }); |