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

No stats from plugin #287

Closed
toptalo opened this issue Oct 8, 2024 · 26 comments
Closed

No stats from plugin #287

toptalo opened this issue Oct 8, 2024 · 26 comments
Assignees
Labels

Comments

@toptalo
Copy link
Contributor

toptalo commented Oct 8, 2024

Hello!
After update to version 4.0.2 I have not see any stats from plugin in dashboard
Is it work?

@AxeR21
Copy link

AxeR21 commented Oct 8, 2024

I'm encountering the same issue even with 4.0.3.
In Chrome DevTools there's the following error:

Uncaught (in promise) NotFoundError: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
    at Proxy.n (index.js:125:26)
    at Proxy.r (index.js:228:25)
    at Object.sendHeartbeats (WakaTimeCore.ts:178:49)
    at async background.ts:12:19

@alanhamlett
Copy link
Member

I've renamed the IndexedDB database and bumped the db version so it's re-created fresh in v4.0.4. Does that fix it?

Duplicate of #286.

@alanhamlett alanhamlett self-assigned this Oct 8, 2024
@alanhamlett alanhamlett added the bug label Oct 8, 2024
@AxeR21
Copy link

AxeR21 commented Oct 8, 2024

Is it normal i see version 4.0.3.2?
Now it seems to work but I had to remove and add extension again to Chrome because evene after upgrading and closing/opening Chrome the issue was still present.
I've noted that in config is still present queueName: 'heartbeatQueue',

In console there are a couple more errors:

Heartbeat 0 returned status: 202
(anonime) @ WakaTimeCore.ts:232
Heartbeat 1 returned status: 202
(anonime) @ WakaTimeCore.ts:232
Heartbeat 2 returned status: 202
(anonime) @ WakaTimeCore.ts:232
Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.
    at l (browser-polyfill.js:1154:18)

@alanhamlett
Copy link
Member

It's v4.0.3.2 because I reverted a rollback and chrome doesn't allow duplicate versions.

Those errors will go away with v4.0.4.

@AxeR21
Copy link

AxeR21 commented Oct 8, 2024

Now I'm on 4.0.4 and it does register stats successfully. There's still the browser-plolyfill error.
Thanks for the amazing support and quick resolution

@sjclayton
Copy link

sjclayton commented Oct 8, 2024

Stats not being reported for me here on Firefox using 4.0.4, it's been over a week (probably from around v3.0.22) since I've had anything reported from in Firefox, I use wakapi.dev... Just actually noticed this yesterday, thought something looked off with my times.

All my other plugins (editors) work with my wakapi instance still... just not the browser extension, nothing changed with my setup other than updating the extension.

@toptalo
Copy link
Contributor Author

toptalo commented Oct 8, 2024

Updated to 4.0.4 and now looks like all works fine

Thanks!

@Atko
Copy link

Atko commented Oct 8, 2024

@sjclayton that's probably related to the issue #282. I have the same problem under ffox since the plugin version 3.0.24.

@alanhamlett
Copy link
Member

@sjclayton is it working with v4.0.5?

@sjclayton
Copy link

sjclayton commented Oct 8, 2024

@alanhamlett No it's not... it can't seem to hit the endpoint on my wakapi instance at all now... I keep seeing 404's even trying to retrieve the today's time.

Seems like you are appending additional duplicate API path's on top of what wakapi is already expecting, and that is making it 404 on everything. The extension can't get a total daily time, let alone that it still does not appear to be even trying to send heartbeats to the wakapi instance. Like I see zero POST requests in my logs, not even attempts that end up failing.

@alanhamlett
Copy link
Member

What's your API url setting set to?

@sjclayton
Copy link

sjclayton commented Oct 8, 2024

This is what was working previously, before the extension was updated.... which I figure things broke sometime around v3.0.22-3.0.24

https://waka.clayton-tech.ca/api/compat/wakatime/v1

That is the API url I have set for the extension, it's for my self hosted wakapi instance, it's not publicly accessible.

Now any GET requests the extension is trying to send are failing, because it seems to be appending /api/v1 to the end of the existing url, even though it shouldn't need it. Also like I said I see no POST attempts even with the messed up API path.

@alanhamlett
Copy link
Member

Try with v4.0.6.

@sjclayton
Copy link

sjclayton commented Oct 8, 2024

The GET requests appear to be returning 200 now... but I still see no daily total time in the extension, and it's still not sending heartbeats (zero POST requests at all) to the wakapi server.... so it's back to where it was as of v4.0.4 from what I can see.

@sjclayton
Copy link

sjclayton commented Oct 8, 2024

@alanhamlett

Quick question -- has the format for associating sites to a "Project" changed recently...? I have the extension set to only log allowed sites.

The format I use for a site is this, example:

https://github.com@@code to log all github.com accesses with the project / tag "code"... this is what has previously worked.

Just want to double check, just in case something has changed that I need to update with the URL's for the sites I track.

@alanhamlett
Copy link
Member

Yes, we changed the format to remove @@ and have a structured UI for customizing projects.

@sjclayton
Copy link

sjclayton commented Oct 8, 2024

@alanhamlett

Ok... I don't actually use Wakatime directly, only Wakapi... so therefore I don't login to the extension... is there any way to do this in the extension without using a Wakatime account?

If not then I won't be able to make use of Wakapi with the extension anymore for tracking websites, and will only be able to use the editor plugins. 😞

@alanhamlett
Copy link
Member

Login happens when you enter your api key, it doesn't mean you need to actually login to any website.

@sjclayton
Copy link

sjclayton commented Oct 8, 2024

@alanhamlett

Ok, but this new structured UI for specifying projects associated to a URL that you mentioned is no where to be found in the extension in Firefox.. is there something I'm missing?

That is what I was trying to get at in my last comment, if it involves something I can't directly do in the extension or in some other way... then I won't be able to track things the way I need to anymore.

@alanhamlett
Copy link
Member

alanhamlett commented Oct 8, 2024

Click the extension icon, then click Options and look for these two sections:

Here's the Only track these sites setting:
Screenshot 2024-10-09 at 12 49 56 AM

And the separated out Custom project names setting:
Screenshot 2024-10-09 at 12 49 45 AM

@sjclayton
Copy link

Holy shit I'm blind.... Nevermind, I was just in there earlier to grab the API url and looked right at that too, and wondered what it was...

Maybe that's why I asked about the "@@", my brain does weird things like that...

@alanhamlett
Copy link
Member

Closing this because it's most likely due to the only track allowed sites setting.

@alanhamlett
Copy link
Member

alanhamlett commented Oct 9, 2024

@sjclayton the reason it's not working for you is this:

muety/wakapi#688

You can modify the browser extension to remove id from the JSON post payload, and convert time from String to number. Run npm i then run npm run build and load the unpacked extension from the resulting dist/chrome folder.

That way it will work right away instead of waiting for the issue to get fixed.

@sjclayton
Copy link

@alanhamlett

Thanks for the prompt replies, I will follow the wakapi issue so I know when things are fixed on their end. 😃

@rob4226
Copy link

rob4226 commented Oct 11, 2024

I changed this line in the browser extension:

return { ...heartbeat, userAgent };

to:

return { ...heartbeat, userAgent, id: undefined, time: +heartbeat.time };

to get the browser extension to work in the meantime.

Edit:
@alanhamlett Yes, that's true. For some reason I thought heartbeat.time was some ISO type date string. I updated the code above to use the real heartbeat time.

@alanhamlett
Copy link
Member

This is better to not overwrite the heartbeat timestamp:

return { ...heartbeat, userAgent, id: undefined, time: Number(heartbeat.time) };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants