Re-creating .wakatime-project
Closed this issue · 9 comments
Hi, I am a bit confused and need some discussion to understand if the problem is with wakatime or with my setup:
- macOS Sequoia
- Zed editor
- Using published wakatime plugin by @bestgopher (it uses wakatime-cli and wakatime-lsp)
Now, my project is at work, so it uses all the hide_xxx options in wakatime config, and also a pre-existing committed .wakatime-project file. BUT, every time I do editing, this file is recreated with a new unique name, I do not yet know the frequency of this change, but I can see there are A LOT of random projects reported in the UI, each with approximately 10 minutes of time logged, so I suppose this re-creation happens at about 10 minute interval.
I want to understand why it is happening and how to prevent this? Any ideas are welcome, I will test them out.
The hide_project_names
creates that file if it doesn't exist, but it should only create it once. One of these is happening:
- something is deleting the
.wakatime-project
file causing wakatime-cli to re-create it - a bug in wakatime-cli is re-creating
.wakatime-project
because it thinks it doesn't exist
What version of wakatime-cli are you using? Run this to find out:
~/.wakatime/wakatime-cli --version
My guess is there's a bug in wakatime-cli where it fails reading the project file and then re-creates it.
Also, are there any errors in your ~/.wakatime/wakatime.log
file? Could you paste the contents here, or if it's too large email to support@wakatime.com?
Let's see if #1104 fixes it. That prevents ever re-creating an already existing .wakatime-project
file.
After that's merged, run rm ~/.wakatime/wakatime-cli*
then restart Zed to get the new wakatime-cli version. Then if you start seeing Unknown Project
on your dashboard instead of random projects it means the fix worked, but wakatime-cli is having trouble reading your .wakatime-project
file for some reason.
@alanhamlett thanks for prompt response!
~/.wakatime/wakatime-cli --version
fish: Unknown command
~/.wakatime/wakatime.log
{"caller":"cmd/run.go:156","func":"cmd.RunE","level":"warning","message":"one of the following parameters has to be provided: --config-read, --config-write, --entity, --file-experts, --offline-count, --print-offline-heartbeats, --sync-offline-activity, --today, --today-goal, --user-agent, --version","now":"2024-08-05T19:52:32+03:00","os/arch":"darwin/arm64","version":"v1.98.3"}
{"caller":"pkg/api/api.go:103","file":"/Users/berkus/**FILENAME REDACTED**","func":"api.isLocalIPv6","is_write":true,"level":"warning","message":"failed dialing to detect default local ip address: dial udp 143.244.210.202:80: connect: network is unreachable","now":"2024-09-09T15:55:30+03:00","os/arch":"darwin/arm64","plugin":"Zed/0.151.2 Zed-wakatime/0.1.2","time":1725886530,"version":"v1.98.3"}
nothing else in there.
Where's your wakatime-cli
located? Maybe the Zed extension puts it inside the LSP extension's folder?
I think you need to re-install the zed extension to get the updated wakatime-cli.
@alanhamlett thanks for prompt response!
~/.wakatime/wakatime-cli --version
fish: Unknown command
~/.wakatime/wakatime.log
{"caller":"cmd/run.go:156","func":"cmd.RunE","level":"warning","message":"one of the following parameters has to be provided: --config-read, --config-write, --entity, --file-experts, --offline-count, --print-offline-heartbeats, --sync-offline-activity, --today, --today-goal, --user-agent, --version","now":"2024-08-05T19:52:32+03:00","os/arch":"darwin/arm64","version":"v1.98.3"} {"caller":"pkg/api/api.go:103","file":"/Users/berkus/**FILENAME REDACTED**","func":"api.isLocalIPv6","is_write":true,"level":"warning","message":"failed dialing to detect default local ip address: dial udp 143.244.210.202:80: connect: network is unreachable","now":"2024-09-09T15:55:30+03:00","os/arch":"darwin/arm64","plugin":"Zed/0.151.2 Zed-wakatime/0.1.2","time":1725886530,"version":"v1.98.3"}
nothing else in there.
~/Library/Application Support/Zed/extensions/work/wakatime/
~/Library/Application Support/Zed/extensions/work/wakatime/
ls: ~/Library/Application Support/Zed/extensions/work/wakatime/: No such file or directory
Hmm, I have not seen this for a while. Must have been some botched installation or something. After reinstalling the plugin it's all clean for a while!