activitywatch icon indicating copy to clipboard operation
activitywatch copied to clipboard

Query tab does not send request and __CATEGORIES__ fails after page reload until switching tabs

Open N0LOD1N opened this issue 6 months ago • 1 comments

  • [x] I am on the latest ActivityWatch version.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • OS name and version: Microsoft Windows 11 Pro, Version 10.0.22631 Build 22631
  • ActivityWatch version: v0.13.2

Describe the bug

When the page is refreshed and the Query tab is opened first, running a query that uses CATEGORIES fails with: Categories was used in query, but no categories have been defined yet. No /api/0/query request is sent in Network tab. The issue disappears if I switch to another tab (e.g., Reports) and back to Query — then queries run normally.

To Reproduce

  1. Open ActivityWatch Web UI in browser, Query page.
  2. Press F12 → go to Network → enable Preserve log.
  3. Refresh the page (F5).
  4. Click Run on a query using CATEGORIES.
  5. Observe that:
  • No /api/0/query request is sent.
  • Error message appears: Categories was used in query, but no categories have been defined yet.

Workaround: Switch to another tab (Reports or Settings), then back to Query. After that, queries run normally and /api/0/query requests are sent.

Expected behavior

Queries in Query tab should work immediately after page reload without needing to switch tabs first.

Documentation

Image Image Image

Additional context

N0LOD1N avatar Aug 14 '25 07:08 N0LOD1N

Hi there! As you're new to this repo, please make sure you've used an appropriate issue template and searched for duplicates (it helps us focus on actual development!). We'd also like to suggest that you read our contribution guidelines and our code of conduct. Thanks a bunch for opening your first issue! 🙏

github-actions[bot] avatar Aug 14 '25 07:08 github-actions[bot]