Chrome 66 random "Aw, snap" on the ticket page

We've figured the reason behind the random Chrome crashes. Chrome 66 introduced a bug - probably a memory leak - that caused the ticket page to crash after being open for about 40 minutes.


If you don't want to wait for a new Jitbit release here is what you can do to fix it.


The fix is for the on-premise version 9.4 or lower only. Hosted version is fixed.

1. Open Views\Ticket\ViewTicket.js in a text editor.
2. Search for "function StartTimeSpentTimer"
3. Currently it looks like this:
function StartTimeSpentTimer() {
if(HDApp.AutoTimerEnabled) {
var existingTime = $('#lblTimeSpent').html();
var timeArr = existingTime.split(":");
var minutesTimer = +timeArr[1];
var secondsTimer = +timeArr[2];
var hoursTimer = +timeArr[0];
_stopwatch = setInterval(function () {
secondsTimer++;
if(secondsTimer==60) {secondsTimer=0; minutesTimer++;}
if(minutesTimer==60) {minutesTimer=0; hoursTimer++;}
var strTime = "0".substring(hoursTimer >= 10) + hoursTimer +":" + "0".substring(minutesTimer >= 10) + minutesTimer + ":" + "0".substring(secondsTimer >= 10) + secondsTimer;
$('#lblTimeSpent').html(strTime);
}, 1000);

$(window).on("beforeunload", AutoSaveTimeSpent);
}
}
4. Make it to look like this:
function StartTimeSpentTimer() {
if (HDApp.AutoTimerEnabled) {
var elem = document.getElementById('lblTimeSpent');
var existingTime = elem.innerText;
var timeArr = existingTime.split(":");
var seconds = 0;
seconds += parseInt(timeArr[2]);
seconds += parseInt(timeArr[1]) * 60;
seconds += parseInt(timeArr[0]) * 3600;
_stopwatch = setInterval(function () {
seconds++;
var date = new Date(null);
date.setSeconds(seconds);
elem.innerText = date.toISOString().substr(11, 8);
}, 1000);

$(window).on("beforeunload", AutoSaveTimeSpent);
}
}
5. Clear cache in Chrome
Creation date: 05/05/2018 05:10 Max      Updated: 11/05/2018 14:18 Max
Description of known error messages and respective solutions.