Repository navigation
fix(queries): use real bucket ids for synced hosts in single-host views - #1068
Conversation
Search, Report, Graph, Alerts, Trends and Category Builder built 'aw-watcher-window_<host>' / 'aw-watcher-afk_<host>' by hand. Buckets synced via aw-sync carry a '-synced-from-<device>' suffix, so selecting a synced host in these views queried a bucket that doesn't exist. Add a desktopBucketIds(host) getter to the buckets store that returns the host's actual window/afk bucket ids, falling back to the conventional ids when none are loaded, and use it at all six call sites. Same fix the Activity view got in ActivityWatch#969. Git-Session-Id: c7e4
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1068 +/- ##
==========================================
+ Coverage 63.30% 63.34% +0.04%
==========================================
Files 52 52
Lines 3608 3612 +4
Branches 892 894 +2
==========================================
+ Hits 2284 2288 +4
+ Misses 1309 1243 -66
- Partials 15 81 +66 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click. This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted. |
Upstream highlights: - feat: custom date range period (ActivityWatch#1005) - feat: device selection (all / subset) in Activity view (ActivityWatch#1004) - feat: category rule priority (ActivityWatch#968) - feat: layered category sets (ActivityWatch#1027, ActivityWatch#1072) - feat: always show Year period (ActivityWatch#1003) - feat: AI summary privacy filter (ActivityWatch#948) - feat: 'Add on top of mine' import option (ActivityWatch#1071) - fix: multidevice queries use real bucket IDs (ActivityWatch#969, ActivityWatch#1068) - fix: timeline hourly bar Y-axis >1h (ActivityWatch#1021) - fix: CSV streaming export (ActivityWatch#993, ActivityWatch#997) - fix: Android browser data display (ActivityWatch#1069) - fix: various mobile/dark-mode/layout improvements Conflict resolution: took upstream for activity.ts (major refactor), multidevice.ts (Android support), Activity.vue, TimelineBarChart.vue, summary.ts. Re-applied our fixes on top: - query_active_history: bucket_sig cache clearing + per-event interval union (dead-watcher marathon immunity) - query_active_history_multidevice: bucket_sig + period-length cap - Removed useMultidevice references (upstream removed the setting in favour of device-selection UI); our code paths now always aggregate across all hosts
Same bug class as #969 (Activity multi-device), #970 (Timeline) and #1067 (Work Report), in the six views that remained.
Bug: Search, Report, Graph, Alerts, Trends and Category Builder build the query bucket IDs by hand:
'aw-watcher-window_' + hostand'aw-watcher-afk_' + host. Buckets synced via aw-sync keep their hostname but have a-synced-from-<device>suffix in their ID. So when you pick a synced host in any of these views (their host pickers list synced hostnames), the query asks for a bucket that doesn't exist and fails with BucketNotFound.Fix: a
desktopBucketIds(host)getter on the buckets store returns{ bid_window, bid_afk }from the host's actual buckets (bucketsWindow(host)[0],bucketsAFK(host)[0]). When no matching bucket is loaded it falls back to the conventional ID, so behaviour for local hosts and for an unloaded store is unchanged. All six call sites use it. Each one is a two-line swap.queries.tskeeps its conventional default becausehost_paramsfrombuildMultideviceHostParamsoverride it.Tests: new store tests cover a synced host, a local host and the unloaded fallback. Full jest suite passes (483/483), along with eslint,
tsc --noEmitandvue-cli-service build.Not verified: a live render with synced buckets on a running server.