Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User agent string from desktop-wakatime parsed improperly #686

Closed
Bashev opened this issue Oct 8, 2024 · 4 comments
Closed

User agent string from desktop-wakatime parsed improperly #686

Bashev opened this issue Oct 8, 2024 · 4 comments
Assignees
Labels
bug Something isn't working effort:2 prio b

Comments

@Bashev
Copy link

Bashev commented Oct 8, 2024

From few months wakatime has desktop app (https://github.com/wakatime/desktop-wakatime) and it seems to works with wakapi, but ... data comes with some deviations in editors section.

Desktop App partially covered support of different apps which can be tracked and is useful workaround if your tool is not supported natively yet.

Wakapi
image

Wakatime
image

Is it a data "mapping" issue or something changed on the wakatime side? Can this be applied to wakapi?

@muety
Copy link
Owner

muety commented Oct 8, 2024

Didn't know about the desktop app, very interesting. Thanks for reporting this! I'll have an in-depth look soon and keep you posted.

@muety
Copy link
Owner

muety commented Oct 13, 2024

Unfortunately, I can't currently use the app due to wakatime/desktop-wakatime#44. However, I dug through the code a bit and gathered a couple of hints.

Plugin user agent string is constructed in wakatime.ts#L244 with the versionString part being something like windows-wakatime/1.2.3. The user agent string then perhaps becomes something like <appName>/1.2.3 windows-wakatime/1.2.3. Wakapi uses the regex in http.go#L88 to parse that user agent string and default UA parsing as a fallback.´

Most probably, the issue lies somewhere in how we parse the user agent strings. To debug this further, however, I'd have to know exactly how the plugin constructs them and see some examples.

@Bashev, are you on Wakapi.dev? If yes, could you share your user name, please? If you're self-hosting instead, could you do me a favor and send some exemplary rows from your database's heartbeats table, that correspond to heartbeats sent by the desktop app?

@muety muety changed the title Desktop App differences in data collection and processing User agent string from desktop-wakatime parsed improperly Oct 13, 2024
@muety muety self-assigned this Oct 13, 2024
@muety muety added bug Something isn't working prio b effort:3 effort:2 and removed effort:3 labels Oct 13, 2024
@Bashev
Copy link
Author

Bashev commented Oct 14, 2024

CSV wakapi-desktop-extracted-heartbeats.csv or SQL wakapi-desktop-extracted-heartbeats.zip

Looks like Editor is not recognized or overridden by 'Windows' for example:

  • debugging apps is Postman
  • meeting app is Zoom (but Skype or Microsoft Teams are not recognized to meeting)

@muety
Copy link
Owner

muety commented Nov 3, 2024

Resolved in 699dab8.

@muety muety closed this as completed Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working effort:2 prio b
Projects
None yet
Development

No branches or pull requests

2 participants