unity-wakatime
unity-wakatime copied to clipboard
Handle HTTP status codes
I have an editor component that actively updates while selected, causing very often heartbeats. After a few seconds System.ArgumentException: JSON parse error: Invalid value. starts to appear. Server responses with
<html>
<head><title>405 Not Allowed</title></head>
<body bgcolor="white">
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx</center>
</body>
</html>
Looks like we need to check for response type and react to errors respectively. Like with temporal timeout for 405 and consider other reactions
Alternatively, in case of 405, we can increase Plugin.HEARTBEAT_COOLDOWN
Can implement after understanding Wakatime server responses or hints from @wakatime members
Nice catch. This plugin doesn't currently handle any network errors for sure. It would be good to have a list of known error statuses WakaTime can return. /cc @alanhamlett
There's no 405 reference at dev section
That was a bug in our server's nginx config, where 429 serving a custom static error page turns into 405 because Nginx doesn't allow custom static error pages for POST requests. It's fixed now and the correct 429 response code is returned.