wakatime / vscode-wakatime

Visual Studio Code plugin for automatic time tracking and metrics generated from your programming activity.
https://wakatime.com/vs-code
BSD 3-Clause "New" or "Revised" License
1.2k stars 133 forks source link

Failed fetching today from api #388

Open UnknownSuperficialNight opened 2 months ago

UnknownSuperficialNight commented 2 months ago

Getting this error and no progress shows up in wakatime dashboard

{"caller":"cmd/run.go:99","func":"cmd.Run","level":"debug","message":"command: version","now":"2024-04-13T02:56:00+12:00","os/arch":"linux/amd64","version":"v1.90.0"}
{"caller":"cmd/run.go:117","func":"cmd.Run","level":"debug","message":"command: today","now":"2024-04-13T02:56:01+12:00","os/arch":"linux/amd64","version":"v1.90.0"}
{"caller":"cmd/run.go:341","func":"cmd.runCmd","level":"error","message":"failed to run command: today fetch failed: failed fetching today from api: invalid response status from \"https://wakatime.com/api/users/current/statusbar/today\". got: 404, want: 200. body: \"{\\\"error\\\": \\\"Not found\\\"}\"","now":"2024-04-13T02:56:02+12:00","os/arch":"linux/amd64","version":"v1.90.0"}
UnknownSuperficialNight commented 2 months ago

looking through the api i can get a return not on https://wakatime.com/api/users/current/statusbar/today but i can get a return on https://wakatime.com/api/v1/users/current/status_bar/today

alanhamlett commented 2 months ago

What's your ~/.wakatime.cfg contents? (minus your api key)

My guess is there's an api_url line in your config that's set the api base url without the v1 part.

UnknownSuperficialNight commented 2 months ago

What's your ~/.wakatime.cfg contents? (minus your api key)

My guess is there's an api_url line in your config that's set the api base url without the v1 part.

This is my wakatime.cfg

[settings] api_key = $(api_key) api_url=https://wakatime.com/api hide_branch_names=true hide_project_folder=true hidefilenames=false

debug = true

Should it be like this?

api_url=https://wakatime.com/api/v1

alanhamlett commented 2 months ago

You should remove the api_url line then it will work, or yes with the v1 in the url also works.