From b513f27dc693ef1f789a7c2f17e6ca218ebc339d Mon Sep 17 00:00:00 2001 From: Miodec Date: Sat, 13 Mar 2021 01:27:29 +0000 Subject: [PATCH] panic logs, added below 0 check --- functions/index.js | 14 ++++++++++++++ src/js/script.js | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/functions/index.js b/functions/index.js index 00d2d1a64..e139f939c 100644 --- a/functions/index.js +++ b/functions/index.js @@ -1052,6 +1052,13 @@ async function getIncrementedTypingStats(userData, resultObj) { } tt = resultObj.testDuration + resultObj.incompleteTestSeconds - afk; + if (tt > 500) + console.log( + `FUCK, INCREASING BY A LOT ${resultObj.uid}: ${JSON.stringify( + resultObj + )}` + ); + if (userData.startedTests === undefined) { newStarted = resultObj.restartCount + 1; } else { @@ -1253,6 +1260,13 @@ exports.testCompleted = functions.https.onRequest(async (request, response) => { let obj = request.obj; + if (obj.incompleteTestSeconds > 500) + console.log( + `FUCK, HIGH INCOMPLETE TEST SECONDS ${request.uid}: ${JSON.stringify( + obj + )}` + ); + function verifyValue(val) { let errCount = 0; if (val === null || val === undefined) { diff --git a/src/js/script.js b/src/js/script.js index e352c477f..8b3b197dc 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -2052,7 +2052,10 @@ function showResult(difficultyFailed = false) { timestamp: Date.now(), language: lang, restartCount: TestStats.restartCount, - incompleteTestSeconds: Misc.roundTo2(TestStats.incompleteSeconds), + incompleteTestSeconds: + TestStats.incompleteSeconds < 0 + ? 0 + : Misc.roundTo2(TestStats.incompleteSeconds), difficulty: config.difficulty, testDuration: testtime, afkDuration: afkseconds, @@ -3029,6 +3032,8 @@ function restartTest(withSameWordset = false, nosave = false, event) { wpmOverTimeChart.update(); updateTestModesNotice(); pageTransition = false; + // console.log(TestStats.incompleteSeconds); + // console.log(TestStats.restartCount); } ); }