Skip to content

Error in $[0].cursorpos: parsing Text failed, expected String, but encountered Number #46

@SCLeoX

Description

@SCLeoX

I am using the WakaTime official vscode extension. I noticed that my extension started to error out since about 3 days ago:

image

My WakaTime extension log is filled with the following error message:

"caller":"/Users/runner/work/wakatime-cli/wakatime-cli/cmd/legacy/run.go:194","func":"runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later due to bad request: bad request at \"https://<My domain>/api/v1/users/current/heartbeats.bulk\"","now":"2021-09-19T21:43:27-04:00","version":"v1.26.0"}

Not very helpful :/

I captured a packet that the extension is sending to my HakaTime instance, and tried to replicate it, so I can see the error message. The response was the following:

{
    "error": "BadRequest",
    "message": "Error in $[0].cursorpos: parsing Text failed, expected String, but encountered Number"
}

Once I changed the fields cursorpos and lineno to strings (wrapping them with quotation marks), the requests went through fine.

P.S. There is also a suspicious update in the WakaTime vscode extension 3 days ago adding the support for those two fields, and I suspect this has something to do with this issue..

P.P.S. I would gladly work on this issue if I can, but for the love of god I cannot understand Haskell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions