wakatime / sketch-wakatime

Sketch plugin for automatic time tracking and metrics generated from your Sketch usage.
https://wakatime.com/sketch
BSD 3-Clause "New" or "Revised" License
62 stars 5 forks source link

No time Record #8

Closed ChesterYue closed 2 years ago

ChesterYue commented 2 years ago

Sketch Version:

Screen Shot 2022-01-24 at 10 25 15 AM

Sketch Plugin & API Key was set:

Screen Shot 2022-01-24 at 10 25 27 AM

Plugin Status:

Screen Shot 2022-01-24 at 10 24 21 AM
ChesterYue commented 2 years ago

wakatime-cli installed with brew:

Screen Shot 2022-01-24 at 10 29 28 AM
gandarez commented 2 years ago

Are you behind a proxy? Have you seen any data on dashboard before? Any error or warning on ~/.wakatime.log?

ChesterYue commented 2 years ago

Are you behind a proxy? Have you seen any data on dashboard before? Any error or warning on ~/.wakatime.log?

Are you behind a proxy? No. And other IDE work well, VSCode / Vim;

Have you seen any data on dashboard before: Yes. but it was maybe other wakatime-cli version or other sketch plugin version, as you can see here (also wakatime dash board has record): Screen Shot 2022-01-24 at 10 52 31 AM

Any error or warning on ~/.wakatime.log: Maybe no. I didn't find any log relative to the sketch plugin. Most was logged by VSCode single file path error. But, is this used by sketch plugin?: {"caller":"/Users/runner/work/wakatime-cli/wakatime-cli/cmd/run.go:240","func":"runCmd","level":"error","message":"failed to run command: sending heartbeat(s) later due to api error: failed making request to \"https://api.wakatime.com/api/v1/users/current/heartbeats.bulk\": Post \"https://api.wakatime.com/api/v1/users/current/heartbeats.bulk\": EOF","now":"2022-01-23T18:29:47+08:00","version":"v1.35.0"}

ChesterYue commented 2 years ago

try reinstall to plugin 2.0, it works (and the cli version shown here is the 10.6.1):

Screen Shot 2022-01-24 at 10 59 34 AM Screen Shot 2022-01-24 at 11 00 02 AM
gandarez commented 2 years ago

Version 2.0 is 3y old and it uses the legacy and outdated python cli. Try running ~/.wakatime/wakatime-cli --offline-count.

ChesterYue commented 2 years ago

Version 2.0 is 3y old and it uses the legacy and outdated python cli. Try running ~/.wakatime/wakatime-cli --offline-count.

you mean the cli with darwin-amd64 suffix? the ~/.wakatime/wakatime-cli with no suffix is a folder.

Screen Shot 2022-01-24 at 11 21 11 AM
ChesterYue commented 2 years ago

And i reinstall from 2.0 to 3.0.1 ~/.wakatime/wakatime-cli-darwin-amd64 --offline-count still 0.

alanhamlett commented 2 years ago

Can you try deleting your ~/.wakatime/ folder and then restart Sketch? That will re-download wakatime-cli to ~/.wakatime/ since it should be a symlink at ~/.wakatime/wakatime-cli not a folder.

Every time you restart Sketch, the wakatime plugin runs this install script.

ChesterYue commented 2 years ago

Can you try deleting your ~/.wakatime/ folder and then restart Sketch? That will re-download wakatime-cli to ~/.wakatime/ since it should be a symlink at ~/.wakatime/wakatime-cli not a folder.

Every time you restart Sketch, the wakatime plugin runs this install script.

After delete the whole ~/.wakatime/ folder. Restart Sketch with plugin 3.0.1:

  1. ~/.wakatime/wakatime-cli link to ~/.wakatime/wakatime-cli-darwin-amd64.
  2. with the folder is deleted, ~/.wakatime/wakatime-cli-darwin-amd64 is not there.
  3. the wakatime-cli.zip here seems empty.
Screen Shot 2022-01-24 at 2 11 34 PM
ChesterYue commented 2 years ago

After run the scripts manually, seems download / unzip / link success:

Screen Shot 2022-01-24 at 2 20 41 PM

And, the plugin status shows right:

Screen Shot 2022-01-24 at 2 21 34 PM
ChesterYue commented 2 years ago

I re delete the folder several times then restart Sketch. It can download / unzip / link success. Not sure why the first time not working. (Maybe the networking? No?)

ChesterYue commented 2 years ago

two question remains:

  1. was the folder and link conflict above caused by upgrade from 2.0 to 3.0?
  2. what's the difference between ~/.wakatime/wakatime-cli(link to ~/.wakatime/wakatime-cli-darwin-amd64) with /usr/local/bin/wakatime-cli (installed with home brew)? different IDE not use the same?
alanhamlett commented 2 years ago

Installing wakatime-cli with Homebrew (/usr/local/bin/wakatime-cli) is only needed for the Emacs and Terminal plugins. All other WakaTime plugins download wakatime-cli automatically into ~/.wakatime/wakatime-cli-<os>-<arch> and symlink ~/.wakatime/wakatime-cli for some plugins (Vim) to make it simpler and faster. Vim needs to fork a process to detect os/arch so it uses the symlink to speed up startup time.

Now that it's working, it must have been from the old version. It used to use ~/.wakatime/wakatime-master/ for the old wakatime-cli but maybe somehow it used ~/.wakatime/wakatime-cli/ which caused the newest plugin to break. Glad you got it working now!