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

Unnecessary call to find_bucket at activity page #590

Open
Rubikoid opened this issue Jun 13, 2024 · 1 comment
Open

Unnecessary call to find_bucket at activity page #590

Rubikoid opened this issue Jun 13, 2024 · 1 comment

Comments

@Rubikoid
Copy link

Rubikoid commented Jun 13, 2024

Query builder for activity page builds query like:

events = flood(query_bucket(find_bucket("aw-watcher-window_rubi-mbp14")));
not_afk = flood(query_bucket(find_bucket("aw-watcher-afk_rubi-mbp14")));

Where find_bucket is unnecessary because there are already full name of bucket, which can be passed to query_bucket.

In the same time, it find_bucket usage leads to problems when bucket for hostname with some suffix also exists, like in ActivityWatch/activitywatch#998 (comment)

@brayo-pip
Copy link
Member

brayo-pip commented Jun 18, 2024

I think find_bucket is still necessary. On my laptop it doesn't seem to have the hostname and the query looks like this

afk_events = query_bucket(find_bucket("aw-watcher-afk_"));
window_events = query_bucket(find_bucket("aw-watcher-window_"));

I do not know how to fix the suffix issue yet. I will try looking into it.

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

No branches or pull requests

2 participants