{"action":"created","issue":{"url":"https://api.github.com/repos/thomaschampagne/stravistix/issues/283","repository_url":"https://api.github.com/repos/thomaschampagne/stravistix","labels_url":"https://api.github.com/repos/thomaschampagne/stravistix/issues/283/labels{/name}","comments_url":"https://api.github.com/repos/thomaschampagne/stravistix/issues/283/comments","events_url":"https://api.github.com/repos/thomaschampagne/stravistix/issues/283/events","html_url":"https://github.com/thomaschampagne/stravistix/issues/283","id":179678776,"number":283,"title":"Extended stats do not show up anymore","user":{"login":"kzkvh2","id":22489365,"avatar_url":"https://avatars.githubusercontent.com/u/22489365?v=3","gravatar_id":"","url":"https://api.github.com/users/kzkvh2","html_url":"https://github.com/kzkvh2","followers_url":"https://api.github.com/users/kzkvh2/followers","following_url":"https://api.github.com/users/kzkvh2/following{/other_user}","gists_url":"https://api.github.com/users/kzkvh2/gists{/gist_id}","starred_url":"https://api.github.com/users/kzkvh2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kzkvh2/subscriptions","organizations_url":"https://api.github.com/users/kzkvh2/orgs","repos_url":"https://api.github.com/users/kzkvh2/repos","events_url":"https://api.github.com/users/kzkvh2/events{/privacy}","received_events_url":"https://api.github.com/users/kzkvh2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2016-09-28T04:42:46Z","updated_at":"2016-10-02T05:24:34Z","closed_at":null,"body":"The stats disappeared, even for rides where they used to show. Did something change that I am unavare of? is it a bug? Can you pls check? using chrome and v 4.2.1\r\nthanks\r\n![image](https://cloud.githubusercontent.com/assets/22489365/18900907/69c460ea-8546-11e6-9b0b-2f6853e2c4a6.png)\r\n"},"comment":{"url":"https://api.github.com/repos/thomaschampagne/stravistix/issues/comments/250954522","html_url":"https://github.com/thomaschampagne/stravistix/issues/283#issuecomment-250954522","issue_url":"https://api.github.com/repos/thomaschampagne/stravistix/issues/283","id":250954522,"user":{"login":"kzkvh2","id":22489365,"avatar_url":"https://avatars.githubusercontent.com/u/22489365?v=3","gravatar_id":"","url":"https://api.github.com/users/kzkvh2","html_url":"https://github.com/kzkvh2","followers_url":"https://api.github.com/users/kzkvh2/followers","following_url":"https://api.github.com/users/kzkvh2/following{/other_user}","gists_url":"https://api.github.com/users/kzkvh2/gists{/gist_id}","starred_url":"https://api.github.com/users/kzkvh2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kzkvh2/subscriptions","organizations_url":"https://api.github.com/users/kzkvh2/orgs","repos_url":"https://api.github.com/users/kzkvh2/repos","events_url":"https://api.github.com/users/kzkvh2/events{/privacy}","received_events_url":"https://api.github.com/users/kzkvh2/received_events","type":"User","site_admin":false},"created_at":"2016-10-02T05:24:34Z","updated_at":"2016-10-02T05:24:34Z","body":"Ok, just found something strange:\r\nWhen I open several activities in the same chrome instance but on different tabs, the first activity opens OK, then the subsequent activities load with the error. So e.g. if I open this first (https://www.strava.com/activities/706798937) then it opens now OK and this (https://www.strava.com/activities/705613347) shows the error message:\r\n![image](https://cloud.githubusercontent.com/assets/22489365/19018861/b534a116-8870-11e6-924f-807ccf5db13a.png)\r\n![image](https://cloud.githubusercontent.com/assets/22489365/19018864/c39ae8f0-8870-11e6-9d57-7997c254b441.png)\r\n\r\nhere is the error message's code, marked line 67 with bold:\r\n\r\nvar Helper = (function () {\r\n    function Helper() {\r\n    }\r\n    Helper.getSpeedUnitData = function () {\r\n        var measurementPreference = window.currentAthlete.get('measurement_preference');\r\n        var units = (measurementPreference == 'meters') ? 'km' : 'mi';\r\n        var speedUnitPerHour = (measurementPreference == 'meters') ? 'km/h' : 'mi/h';\r\n        var speedUnitFactor = (speedUnitPerHour == 'km/h') ? 1 : Helper.KPH_TO_MPH_RATIO;\r\n        var speedUnitData = {\r\n            speedUnitPerHour: speedUnitPerHour,\r\n            speedUnitFactor: speedUnitFactor,\r\n            units: units\r\n        };\r\n        return speedUnitData;\r\n    };\r\n    Helper.HHMMSStoSeconds = function (str) {\r\n        var p = str.split(':'), s = 0, m = 1;\r\n        while (p.length > 0) {\r\n            s += m * parseInt(p.pop(), 10);\r\n            m *= 60;\r\n        }\r\n        return s;\r\n    };\r\n    Helper.secondsToHHMMSS = function (secondsParam, trimLeadingZeros) {\r\n        var secNum = secondsParam;\r\n        var hours = Math.floor(secNum / 3600);\r\n        var minutes = Math.floor((secNum - (hours * 3600)) / 60);\r\n        var seconds = secNum - (hours * 3600) - (minutes * 60);\r\n        var time = ((hours < 10) ? \"0\" + hours.toFixed(0) : hours.toFixed(0));\r\n        time += ':' + ((minutes < 10) ? \"0\" + minutes.toFixed(0) : minutes.toFixed(0));\r\n        time += ':' + ((seconds < 10) ? \"0\" + seconds.toFixed(0) : seconds.toFixed(0));\r\n        return (trimLeadingZeros ? Helper.trimLeadingZerosHHMMSS(time) : time);\r\n    };\r\n    Helper.trimLeadingZerosHHMMSS = function (time) {\r\n        var result = time.replace(/^(0*:)*/, '').replace(/^0*/, '') || \"0\";\r\n        if (result.indexOf(\":\") < 0) {\r\n            return result + \"s\";\r\n        }\r\n        return result;\r\n    };\r\n    Helper.weightedPercentiles = function (values, weights, percentiles) {\r\n        var list = [];\r\n        var tot = 0;\r\n        for (var i = 0; i < values.length; i++) {\r\n            list.push({ value: values[i], weight: weights[i] });\r\n            tot += weights[i];\r\n        }\r\n        list.sort(function (a, b) {\r\n            return a.value - b.value;\r\n        });\r\n        var result = [];\r\n        for (var i = 0; i < percentiles.length; i++) {\r\n            result.push(0);\r\n        }\r\n        var cur = 0;\r\n        for (var i = 0; i < list.length; i++) {\r\n            for (var j = 0; j < percentiles.length; j++) {\r\n                if (cur < percentiles[j] * tot && (cur + list[i].weight) > (percentiles[j] - 0.00001) * tot) {\r\n                    result[j] = list[i].value;\r\n                }\r\n            }\r\n            cur += list[i].weight;\r\n        }\r\n        return result;\r\n    };\r\n    Helper.heartrateFromHeartRateReserve = function (hrr, maxHr, restHr) {\r\n        **return parseFloat((hrr / 100 * (maxHr - restHr) + restHr).toFixed(0));**\r\n    };\r\n    ;\r\n    Helper.heartRateReserveFromHeartrate = function (hr, maxHr, restHr) {\r\n        return (hr - restHr) / (maxHr - restHr);\r\n    };\r\n    ;\r\n    Helper.setToStorage = function (extensionId, storageType, key, value, callback) {\r\n        chrome.runtime.sendMessage(extensionId, {\r\n            method: Helper.setToStorageMethod,\r\n            params: {\r\n                storage: storageType,\r\n                'key': key,\r\n                'value': value\r\n            }\r\n        }, function (response) {\r\n            if (callback) {\r\n                callback(response);\r\n            }\r\n        });\r\n    };\r\n    ;\r\n    Helper.getFromStorage = function (extensionId, storageType, key, callback) {\r\n        chrome.runtime.sendMessage(extensionId, {\r\n            method: Helper.getFromStorageMethod,\r\n            params: {\r\n                storage: storageType,\r\n                'key': key\r\n            }\r\n        }, function (response) {\r\n            callback(response);\r\n        });\r\n    };\r\n    ;\r\n    Helper.formatNumber = function (n, c, d, t) {\r\n        c = isNaN(c = Math.abs(c)) ? 2 : c,\r\n            d = d == undefined ? \".\" : d,\r\n            t = t == undefined ? \",\" : t;\r\n        var s = n < 0 ? \"-\" : \"\";\r\n        var i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + \"\";\r\n        var j;\r\n        j = (j = i.length) > 3 ? j % 3 : 0;\r\n        return s + (j ? i.substr(0, j) + t : \"\") + i.substr(j).replace(/(\\d{3})(?=\\d)/g, \"$1\" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : \"\");\r\n    };\r\n    ;\r\n    Helper.secondsToDHM = function (sec_num, trimZeros) {\r\n        var days = Math.floor(sec_num / 86400);\r\n        var hours = Math.floor((sec_num - (days * 86400)) / 3600);\r\n        var minutes = Math.floor((sec_num - (days * 86400) - (hours * 3600)) / 60);\r\n        if (trimZeros && days === 0) {\r\n            if (hours === 0) {\r\n                return minutes + 'm';\r\n            }\r\n            return hours + 'h ' + minutes + 'm';\r\n        }\r\n        return days + 'd ' + hours + 'h ' + minutes + 'm';\r\n    };\r\n    ;\r\n    Helper.guid = function () {\r\n        function s4() {\r\n            return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\r\n        }\r\n        return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\r\n    };\r\n    ;\r\n    Helper.versionCompare = function (v1, v2, options) {\r\n        var lexicographical = options && options.lexicographical, zeroExtend = options && options.zeroExtend, v1parts = v1.split('.'), v2parts = v2.split('.');\r\n        function isValidPart(x) {\r\n            return (lexicographical ? /^\\d+[A-Za-z]*$/ : /^\\d+$/).test(x);\r\n        }\r\n        if (!v1parts.every(isValidPart) || !v2parts.every(isValidPart)) {\r\n            return NaN;\r\n        }\r\n        if (zeroExtend) {\r\n            while (v1parts.length < v2parts.length)\r\n                v1parts.push(\"0\");\r\n            while (v2parts.length < v1parts.length)\r\n                v2parts.push(\"0\");\r\n        }\r\n        if (!lexicographical) {\r\n            v1parts = v1parts.map(Number);\r\n            v2parts = v2parts.map(Number);\r\n        }\r\n        for (var i = 0; i < v1parts.length; ++i) {\r\n            if (v2parts.length == i) {\r\n                return 1;\r\n            }\r\n            if (v1parts[i] == v2parts[i]) {\r\n                continue;\r\n            }\r\n            else if (v1parts[i] > v2parts[i]) {\r\n                return 1;\r\n            }\r\n            else {\r\n                return -1;\r\n            }\r\n        }\r\n        if (v1parts.length != v2parts.length) {\r\n            return -1;\r\n        }\r\n        return 0;\r\n    };\r\n    Helper.KPH_TO_MPH_RATIO = 0.621371;\r\n    Helper.getFromStorageMethod = 'getFromStorage';\r\n    Helper.setToStorageMethod = 'setToStorage';\r\n    return Helper;\r\n}());\r\n\r\n\r\n"}}
{"actor":{"display_login":"kzkvh2"}}