Bug "Request error undefined" in ActivityWatch UI
gpassero opened this issue · 6 comments
I ran activitywatch-v0.8.0b6-windows-x86_64 and then opened VS Code v1.30.2 with the aw-watcher-vscode extension v0.4.0 enabled.
After that, I tried to access the ActivityWatch dashboard at http://localhost:5600/#/, tab Activity
, and got this error:
This error was displayed in the browser's console output:
Activity.vue:342 TypeError: Cannot read property 'duration' of undefined
at a.<anonymous> (Activity.vue:413)
at w (runtime.js:65)
at Generator._invoke (runtime.js:299)
at Generator.t.(:5600/anonymous function) [as next] (http://localhost:5600/static/js/0.eb46a9d79636be6aeb56.js:107:16480)
at i (asyncToGenerator.js:17)
at asyncToGenerator.js:28
Also, data is not loaded correctly at the Editor tab, as you can see in this print:
The extension doesn't seem to be compatible with activitywatch-v0.8.0b6. Has anyone tested it with activitywatch-v0.8.0b7?
I wouldn't know, why the duration property shouldn't be set. Because the vscode extension always adds it with the value zero, and then the aw-server should merge them together, so it should be at least zero.
Could you look, if the events in your aw-watcher-vscode bucket (webui->raw data) have this property? Then we would know if the error is at storing the events or at displaying them and it would be easier to track it down :)
Could you look, if the events in your aw-watcher-vscode bucket (webui->raw data) have this property?
Activity.vue:342 TypeError: Cannot read property 'duration' of undefined
If I understand this error message correctly that would mean that we somehow got a non-object in the event array or that the "duration" field in the root query object for the editor query failed to be serialized. Events are required to have a duration so I don't think that's the issue. My guess would be that there's something in the query code in aw-server which fails to serialize an event and puts something invalid there and it silently passes. Another guess would also be an error silently passing in the query code and maybe returning some invalid json which aw-webui now fails to parse.
I would suggest checking the request response from the query in your browser (In Firefox you press F12, the Network tab, refresh the page and find the request to /api/0/query/
where the body starts with editorbucket = "aw-watcher-vscode_l";
and then look at the contents of the response. Looking in the aw-server logs might also be interesting (logs reside in .cache/activitywatch/log/aw-server on Linux, don't know exactly where on other OSes but should be something like $PLATFORMS_DEFAULT_LOG_PATH/activitywatch/log/aw-server
)
It feels much more likely that this is an issue with aw-server than aw-watcher-vscode, but I could be wrong.
Oh, I think my long response is worthless. You mentioned activitywatch-v0.8.0b6-windows-x86_64
which I'm pretty certain has completely broken editor query support. Update to beta7 should fix it!
I'm using Windows and unfortunately the release of activity watcher 0.8.0b7 for Windows is broken.
I'll wait for the fix in their branch. Thanks!
Oh right, forgot about that.
We should hopefully have a new release soon!
Hello,
I am using:
- Windows 10 64bit
- ActivityWatch v0.8.0b6
- Visual Studio Code
+1 for this GitHub issue... I guess I need to downgrade AW version at the moment...