Closed Rj7 closed 5 years ago
Are you keeping your csv files in dropbox or something like that?
@zagortenay333 No I am not keeping my csv files in dropbox or any other service. I tried changing my folder location too. Somehow the logging the start time and end time is messed. Couldn't find a solution in your github issues.
Did you try using the github version?
@zagortenay333 Yes I did. I had the same problem. Another he icon for pomodoro doesn't show up in version from gnome. And it shows up in the version from github.
The tracker will stop whenever the csv file is updated externally. Internally, I disable the file monitors before I attempt to write to the file.
So either I'm failing to disable the file monitors which immediately turns the tracker off (probably), or something on your system updates the file.
Could you throw in a little print statement here just to check this theory: https://github.com/zagortenay333/timepp__gnome/blob/master/sections/todo/time_tracker.js#L171-L172
Something like log(">>>>>>>>>>>>>>>> TIMEPP FILES MODIFIED")
. Check in the journalctl output.
I don't know what to do here honestly; I've been struggling with these freakin' gnome file monitors since the start...
Hi @zagortenay333, I jump in as I have the same problem. Since last update (I did it on Thursday I think) all my attempts to track time result in 1s long time spans. I have inserted logging as you have described and in journalctl output I have a lot of:
gru 23 21:23:53 pc tracker-miner-f[3144]: (Sparql buffer) Error in task 0 (--my-docs-path--/time/TODAY__time_tracker.csv) of the array-update: UNIQUE constraint failed: nie:DataObject.nie:url gru 23 21:23:53 pc tracker-miner-f[3144]: Could not execute sparql: UNIQUE constraint failed: nie:DataObject.nie:url
and those fire several times each second when the tracker is running.
Any other help needed, just let me know.
ps. I use the gnome-extensions version, haven't tried with github one.
@witpok , just throwing a wild guess here: do you have the gnome tracker (the file tracker) running and could you disable it?
Also, could you try the version of timepp on this commit: https://github.com/zagortenay333/timepp__gnome/tree/cb04983a5b14ec6ca8e23ea044f11b34d82a864d
@zagortenay333 I tried adding logging in _on_tracker_files_modified
. When I start a task, it logs multiple times a second. Looks like something is modifying that folder. But I don't have gnome tracker installed it seems. I am not able to find. I just installed it sudo apt install tracker
and will try to stop indexing from timepp folder
I disabled tracking in org.freedesktop.Tracker.Miner.Files enable-monitors
and that doesn't fix the problem.
@zagortenay333 This version that you linked above works fine. I tried that version with tracker (enabled and disabled) and by purging the tracker. It worked in all of those scenarios. Anyways I will stick to this version for now, I guess. Thanks :+1:
@witpok , just throwing a wild guess here: do you have the gnome tracker (the file tracker) running and could you disable it?
Also, could you try the version of timepp on this commit: https://github.com/zagortenay333/timepp__gnome/tree/cb04983a5b14ec6ca8e23ea044f11b34d82a864d
Yeah, so the problem is definitely that the way I disable the file monitor prior to writing to the csv file doesn't work on your machine...
@zagortenay333 can confirm, github version works fine.
@witpok which version? Master branch?
@zagortenay333 the one linked above, https://github.com/zagortenay333/timepp__gnome/tree/cb04983a5b14ec6ca8e23ea044f11b34d82a864d
@zagortenay333 hi, I have reinstalled this extension with gnome extensions version (as it showed there is an update available) but it is not tracking time. I have removed it, then reinstalled latest version from this repository, but time tracking is still not working. I have the same errors as before - Could not execute sparql: UNIQUE constraint failed: nie:DataObject.nie:url Is there any progress here to fix that?
I encountered the same issue and spent some time looking into this problem.
First, I checked with is_cancelled()
after the line disabling the file monitor. It says that the monitor is canceled successfully.
However, even if the monitor is disabled before writing csv file, the callback function is still triggered after enabling the file monitor. I even tried to disconnect the "changed" signal while canceling the monitor, but the issue still exists.
Hope this observation can help. For now I have to disable the file monitor to make time tracking function work.
@zagortenay333 I found out that whenever the file monitor is re-enabled after a file writing behavior, the file monitor starts before the writing process finishes. So I tried to add a 100ms timeout before re-enables the file monitor and that solved the issue. The modification to function _enable_file_monitors() is like the following:
_enable_file_monitors () {
Mainloop.timeout_add(100,()=>{
[this.daily_csv_file_monitor,] = MISC_UTILS.file_monitor(this.daily_csv_file, () => {
this._on_tracker_files_modified();
});
[this.yearly_csv_file_monitor,] = MISC_UTILS.file_monitor(this.yearly_csv_file, () => {
this._on_tracker_files_modified();
});
[this.yearly_csv_dir_monitor,] = MISC_UTILS.file_monitor(this.yearly_csv_dir, () => {
this._on_tracker_files_modified();
});
});
Suggestions: When I tested the code, I realized that you don't need to remove and re-create the file monitor each time modifying a file. It might be cheaper to just disconnect the 'changed' signal from the monitor using the function GFileMonitor.disconnect(monitor_id)
.
Pull requests are welcome.
@zexiangliu Can confirm, your fix is working.
I have been not able to use time tracking since I updated the extensions some 10 days ago. I had tried reinstalling/ resetting gnome multiple times and I still face this problem. I had this problem in gnome 3.28 and still have this problem in gnome 3.30. Had this problem in ubuntu 18.04 and 18.10 ( after updating )
This is how my
TODAY_time_tracker.csv
looksWhen I turn off
restart after abrupt restart
I am not able to start timer for any tasks. If I leave it on, my start time and end time for the task gets updated to my current time. Find the log forjournalctl /usr/bin/gnome-shell -f -o cat
in this gist hereWould really appreciate a fix / solution for this because I love this extension so much.