Open Mte90 opened 2 years ago
This line require a change as this file was moved https://github.com/Tatsh/kate-wakatime/blob/master/wakatimeplugin.cpp#L36
#include <KF5/KTextEditor/ktexteditor_version.h>
My issue is that my API URL has a initial slash (https://wakapi.dev/api//v1/users/current/heartbeats.bulk) but this will be appended with the endpoint URL so doesn't work.
The URL need to be sanitized, I am trying with url.adjusted(QUrl::NormalizePathSegments);
Also on Kate starting I have tons of this:
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788062-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788063-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788092-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788096-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788097-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788098-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788101-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788102-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788103-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788107-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788108-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788110-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788111-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788112-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788116-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788119-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788122-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788123-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788124-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788130-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788132-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788133-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788134-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788141-file-coding-planet--HIDDEN.php-0'"
offlinequeue: connect(): Returning existing db instance
offlinequeue: pop(): executed "DELETE FROM heartbeat_2 WHERE id = '1626788142-file-coding-planet--HIDDEN.php-0'"
Maybe instead to do various queries is enough to do just one.
I will accept a PR to switch over to wakatime-cli #22. I did at one time have a branch for this change (back when wakatime was Python-based) but I found it to be oddly slow.
The biggest concern for the subprocess code is to make certain that the thread is locked/unlocked properly so it cannot run twice simultaneously and does not double post.
I still definitely prefer calling their API without calling a subprocess but ever since adding the heartbeat database code and then WakaTime switching to Go with BDB, this has become difficult to maintain.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
So I was getting some slowness inside Kate, running with shell I am getting this errors.
The line https://github.com/Tatsh/kate-wakatime/blob/d6e5dcde37e875fa4a659a52f97955f5ac4594aa/wakatimeplugin.cpp#L620