Tatsh / kate-wakatime

Kate plugin to interface with WakaTime
https://tatsh.github.io/kate-wakatime/
11 stars 9 forks source link

Nested array #18

Closed Mte90 closed 2 years ago

Mte90 commented 2 years ago

Seems that there is an error so doesn't work with wakapi. Check https://github.com/muety/wakapi/issues/214#issuecomment-880004048

Tatsh commented 2 years ago

Could you delete ~/.wakatime.db and report back? This will delete queued entries and from what I can tell some were stored that were erroneous.

If you really want to test, disconnect your internet so Kate will queue entries (every 2 minutes). Try to get at least a few entries. Close Kate, reconnect and see if Kate can send successfully.

To see queued entries:

sqlite3 ~/.wakatime.db 'select heartbeat from heartbeat_2'

Alternatively you can delete the bad entries:

sqlite3 ~/.wakatime.db 'delete from  heartbeat_2 where heartbeat like "[%"'
Mte90 commented 2 years ago

Removed that file but the issue is still there as you can see from https://bin.muetsch.io/web/wakapi-101?token=NNWZBE6RKa2whIL5mKa_MX7pgSRTHtpD0u5O0fvNaa2J (the latests).

Mte90 commented 2 years ago

Looking it is happening just on a queue heartbeats. I just commented the execution of that function and looking at the endpoint there are no wrong beats.

Tatsh commented 2 years ago

You should check queued heartbeats in the database to ensure they are JSON objects and not arrays. that's where the issue is coming from. A prior buggy version of the plugin made those.