panic logs, added below 0 check

This commit is contained in:
Miodec 2021-03-13 01:27:29 +00:00
parent c585e943b7
commit b513f27dc6
2 changed files with 20 additions and 1 deletions

View file

@ -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) {

View file

@ -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);
}
);
}