From 2880ebe6a3c67d081855798a155b850e54d21ef7 Mon Sep 17 00:00:00 2001 From: zbw8388 Date: Mon, 2 Oct 2023 23:12:48 -0700 Subject: [PATCH] fix: include duration for a more accurate time calculation --- watchers/src/report_client.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/watchers/src/report_client.rs b/watchers/src/report_client.rs index 85c12de..475a53e 100644 --- a/watchers/src/report_client.rs +++ b/watchers/src/report_client.rs @@ -87,7 +87,8 @@ impl ReportClient { let event = AwEvent { id: None, timestamp: Utc::now(), - duration: Duration::zero(), + // Added one nano second to ensure the event is not filtered out by https://github.com/ActivityWatch/aw-webui/blob/cf74080d12ffd53d37c83e3e0eddaf952fe14a62/src/visualizations/VisTimeline.vue#L108 + duration: Duration::from_std(self.config.poll_time_window).unwrap() + Duration::nanoseconds(1), data, };