How to update to v11

I am on macOS Mojave

I have just downloaded the new v11 release, removed the old ActivityWatch application and dragged the new one from the .dmg to my app folder.

When I click on it, it opens up normally. However, in the webapp I’m getting errors “Cannot read property ‘label’ of undefined”

And then I noticed new time isn’t being added. So I ran the aw-qt from the CLI and I’m getting many errors

2021-06-16 11:35:04 [ERROR]: Exception thrown while trying to get active window: error compiling jxa script (aw_watcher_window.main:74)
Traceback (most recent call last):
File “aw_watcher_window/main.py”, line 71, in heartbeat_loop
File “aw_watcher_window/lib.py”, line 55, in get_current_window
File “aw_watcher_window/lib.py”, line 27, in get_current_window_macos
File “aw_watcher_window/macos_jxa.py”, line 37, in getInfo
File “aw_watcher_window/macos_jxa.py”, line 28, in compileScript

Am I missing something for the upgrade? I tried to delete all my old categories and recreate them because the release notes mentioned “(you need to migrate them if you want to keep any modifications)”

Thanks

Hello, I’m seeing similar errors across the Application. I’m using a Fedora 34 (Linux) system

In the Activity tab:
TypeError: Cannot read property 'label' of undefined. See dev console (F12) and/or server logs for more info.

Console throws this:

vue.runtime.esm.js:1888 TypeError: Cannot read property 'label' of undefined
    at TimelineBarChart.vue:99
    at _baseOrderBy.js:39
    at n (_arrayMap.js:16)
    at _baseOrderBy.js:38
    at _baseMap.js:17
    at _createBaseEach.js:24
    at o (_baseMap.js:16)
    at h (_baseOrderBy.js:37)
    at sortBy.js:45
    at n (_apply.js:15)
ie @ vue.runtime.esm.js:1888
activity.ts:158 Cannot call query_editor as we do not have any editor buckets

In Trends, within the Tools tab:
TypeError: Cannot read property 'map' of undefined. See dev console (F12) and/or server logs for more info.

vue.runtime.esm.js:1888 TypeError: Cannot read property 'map' of undefined
    at o.<anonymous> (aw-client.js:168)
    at Generator.next (<anonymous>)
    at aw-client.js:7
    at new Promise (<anonymous>)
    at r (aw-client.js:3)
    at o.query (aw-client.js:165)
    at activity.ts:288
    at l (runtime.js:63)
    at Generator._invoke (runtime.js:293)
    at Generator.next (runtime.js:118)
ie @ vue.runtime.esm.js:1888

I understand “Trends” is still experimental, but it’s odd seeing an error in the Activity tab.

Hmm, this is a bit weird. Did resetting your categories to the defaults get rid of the issue?

Trying to hunt this down, but difficult without knowing how the categories seemingly changed…


2021-06-16 11:35:04 [ERROR]: Exception thrown while trying to get active window: error compiling jxa script (aw_watcher_window.main:74)
Traceback (most recent call last):
  File “aw_watcher_window/main.py”, line 71, in heartbeat_loop
  File “aw_watcher_window/lib.py”, line 55, in get_current_window
  File “aw_watcher_window/lib.py”, line 27, in get_current_window_macos
  File “aw_watcher_window/macos_jxa.py”, line 37, in getInfo
  File “aw_watcher_window/macos_jxa.py”, line 28, in compileScript

This is a separate issue though. A potential workaround is to modify the aw-watcher-window config to use the old ‘applescript’ strategy for getting the active window. Your aw-watcher-window.toml should look something like this:

[aw-watcher-window]
#exclude_title = false
#poll_time = 1.0
strategy_macos = "applescript"

Note however that when you run aw-qt directly you probably don’t have the appropriate accessibility permissions set, so if data is logged correctly when running from the .app but not from running aw-qt directly, then that’s to be expected.

You may also need to re-add ActivityWatch.app to the accessibility permissions when you upgrade, see: https://docs.activitywatch.net/en/latest/updating.html

In my case, reseting the categories to defaults this problem diaspeared. If I reimported my categories the problem started again. I guess at least now we know that it is a categories issue. I have pasted my categories so you can try to reproduce:

{"categories":[{"name":["Work"],"rule":{"type":null},"id":0},{"name":["Work","Programming"],"rule":{"type":"regex","regex":"GitHub|vim|JupyterLab|ssh|iterm2","ignore_case":true},"id":1},{"name":["Work","ActivityWatch"],"rule":{"type":"regex","regex":"ActivityWatch|aw-","ignore_case":true},"id":2},{"name":["Work","Reading Writing"],"rule":{"type":"regex","regex":"Mendeley|Google Scholar","ignore_case":true},"id":3},{"name":["Work","Visualization"],"rule":{"type":"regex","regex":"vmd|maestro|pymol","ignore_case":true},"id":4},{"name":["Work","Comunication"],"rule":{"type":"regex","regex":"zulip|slack|- [email protected] -|zoom","ignore_case":true},"id":5},{"id":6,"name":["Life"],"rule":{"type":null}},{"name":["Life","Video"],"rule":{"type":"regex","regex":"YouTube|Plex|VLC|Netflix|Prime|movistar","ignore_case":true},"id":7},{"name":["Life","Comms"],"rule":{"type":"regex","regex":" - [email protected] - |whatsapp","ignore_case":true},"id":8},{"name":["Life","Music"],"rule":{"type":"regex","regex":"Spotify|Deezer"},"id":9},{"name":["Work","PR"],"rule":{"type":"regex","regex":"linkedin|orcid|twitter|researchgate","ignore_case":true},"id":10},{"name":["Work","Note Taking"],"rule":{"type":"regex","regex":"notion|Google Keep","ignore_case":true},"id":11},{"name":["Work","Writing"],"rule":{"type":"regex","regex":"Google Docs|overleaf|Microsoft Word|Google Slides|Microsoft Powerpoint","ignore_case":true},"id":12}]}

Actually, the label undefined problem disapeared. The window title error with permissions is still there. The “applescript” suggestion doesn’t seem to work either.

The problem with the window titles seems to disappear after adding AW to the following categories in MacOS “Privacy and Security”:

  • Files and Folders
  • Developer tools
  • Automation
    I am not sure which of them is the one that actually does the trick. I hope I am not generating a security hazard in my computer.