Custom editor activity watcher results in Request error on the overview

Hello,

I’ve been working on an emacs activity watch but unfortunately I am having an issue related with the Activity overview tab.

The frontend produces the following error after querying the editor bucket:

TypeError: Cannot read property 'duration' of undefined.

The error happens on Activity.vue line 413 (from the latest github release). I’ve been trying to debug it locally without success.

The query returns the following data, which seems correct to me:

[
  {
    "languages": [
      {
        "id": null, 
        "data": {
          "language": "ruby-mode"
        }, 
        "timestamp": "2018-10-16T07:18:36+00:00", 
        "duration": 168.0
      }, 
      {
        "id": null, 
        "data": {
          "language": "emacs-lisp-mode"
        }, 
        "timestamp": "2018-10-16T07:17:34+00:00", 
        "duration": 146.0
      }
    ], 
    "files": [
      {
        "id": null, 
        "data": {
          "file": "/home/paul/tymate/redacted/app/jobs/feed_activity_notification_job.rb", 
          "language": "ruby-mode"
        }, 
        "timestamp": "2018-10-16T07:18:36+00:00", 
        "duration": 168.0
      }, 
      {
        "id": null, 
        "data": {
          "file": "/home/paul/tymate/wakatime-mode/wakatime-mode.el", 
          "language": "emacs-lisp-mode"
        }, 
        "timestamp": "2018-10-16T07:17:34+00:00", 
        "duration": 146.0
      }
    ], 
    "projects": [
      {
        "id": null, 
        "data": {
          "project": "redacted"
        }, 
        "timestamp": "2018-10-16T07:18:36+00:00", 
        "duration": 168.0
      }, 
      {
        "id": null, 
        "data": {
          "project": "wakatime-mode"
        }, 
        "timestamp": "2018-10-16T07:17:34+00:00", 
        "duration": 146.0
      }
    ], 
    "duration": 314.0
  }
]

Any recommendation on how to proceed next? I would love to resolve these issues and be able to contribute an Emacs activity watch mode!

Just a quick update, I have installed activity watch from git and it works correctly. So I guess all is good now.

I will try to publish the emacs package soon so everyone can benefit from it.

There is a bug specific for 0.7 beta 6 which breaks editor visualization but is fixed in master as you just found out the hard way.
Sorry for the inconvenience! We really should make a new release…

Awesome with the emacs watcher! Looking forward to testing it out :slight_smile:

There it is https://github.com/pauldub/activity-watch-mode I also have submitted a PR for inclusion into MELPA: https://github.com/melpa/melpa/pull/5759

2 Likes

Hi, I’m getting the same error. I’m working on an plugin for Visual Studio in C#, I’m able to send events to the server, database looks promising, but I get that exact TypeError from above.

I quickly tried to install aw-server which worked, but get 404 on the dashboard.
Is there a new (beta, whatever) release I could use?

Sorry for the late reply

As stated above, this issue is fixed by upgrading to 0.8 beta 7, so try that!

I assume that you mean that you tried to build it from source?
You’re likely not building it correctly and have missed to build aw-webui and bundling it with aw-server. How to build correctly from source can be found here https://activitywatch.readthedocs.io/en/latest/installing-from-source.html?highlight=source

Hi, better late than never :slight_smile:
I’m on Windows, so this version is broken. And yes, i tried to build it on windows, fixed some errors, but it didn’t work out.

This doesn’t matter for developing, I reviewed my events in the database and they look fine. I’ve some questions for development, but will start a new thread as this isn’t related.

Thanks so far.

Oh right, forgot about that.
Will try to push a new version soon!

1 Like