From fc6ff016a7b01f948173ed7e941f253f1ceeb91c Mon Sep 17 00:00:00 2001 From: advplyr Date: Sat, 8 Jul 2023 08:08:14 -0500 Subject: [PATCH] Update:Playback sync request timeout to 9s and show sync alerts after 4 failed syncs #1884 --- client/players/PlayerHandler.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/players/PlayerHandler.js b/client/players/PlayerHandler.js index 5821aee1..0da74a70 100644 --- a/client/players/PlayerHandler.js +++ b/client/players/PlayerHandler.js @@ -319,7 +319,7 @@ export default class PlayerHandler { } this.listeningTimeSinceSync = 0 this.lastSyncTime = 0 - return this.ctx.$axios.$post(`/api/session/${this.currentSessionId}/close`, syncData, { timeout: 4000 }).catch((error) => { + return this.ctx.$axios.$post(`/api/session/${this.currentSessionId}/close`, syncData, { timeout: 6000 }).catch((error) => { console.error('Failed to close session', error) }) } @@ -339,12 +339,13 @@ export default class PlayerHandler { } this.listeningTimeSinceSync = 0 - this.ctx.$axios.$post(`/api/session/${this.currentSessionId}/sync`, syncData, { timeout: 6000 }).then(() => { + this.ctx.$axios.$post(`/api/session/${this.currentSessionId}/sync`, syncData, { timeout: 9000 }).then(() => { this.failedProgressSyncs = 0 }).catch((error) => { console.error('Failed to update session progress', error) + // After 4 failed sync attempts show an alert toast this.failedProgressSyncs++ - if (this.failedProgressSyncs >= 2) { + if (this.failedProgressSyncs >= 4) { this.ctx.showFailedProgressSyncs() this.failedProgressSyncs = 0 }