You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AxiosError: timeout of 30000ms exceeded while trying to see activity for one month #629
While trying to view my activity for 2026-06 at http://localhost:5600/#/activity/your_hostname_here/month/2026-06-01/view/summary
I get AxiosError: timeout of 30000ms exceeded. See dev console (F12) and/or server logs for more info. and my views hang with "Loading..." in them. Nothing particularly interesting after pressing F12.
My ~/.local/share/activitywatch/aw-server-rust/sqlite.db is 168 MB big and contains data since 2024-01.
aw-server process gets from 20 MB in RAM to something over 100 MB when trying to display the report. It looks like it's trying to load whole database instead of only the time period that I'm interested in.
This is kind of a wish than a bug: Could ActivityWatch be made so that it doesn't start to time out on reports when there is more data in the database? I remember watching 1 month time periods without problem earlier on.
Root cause: in was evaluating every event against every regex rule individually — ~1M evaluations for a typical month (50k+ events × 20 rules). Most events share identical app/title data, so the same matches were recomputed thousands of times.
Fix: added a -based cache inside keyed on the serialized event data. Only the first occurrence of each distinct data fingerprint hits the regex engine; subsequent identical events reuse the cached category. For 50k events with ~200 distinct app/title pairs this reduces regex work from 1M to ~4k evaluations (~250×).
Thanks. This fixes my error. I'm afraid that these optimizations to regex might not hold long enough, once I'll have even larger database.
If I understood the fix correctly, still every event (instead of only events in the selected time period) in my database goes through regex evaluation.
That's not how the query path works — regex never runs over the whole database.
query_bucket() always fetches only the selected time range. The month view sets TIMEINTERVAL to that month, and the datastore query is:
SELECT id, starttime, endtime, data
FROM events
WHERE bucketrow = ?
AND endtime >=<month start>AND starttime <=<month end>
(aw-datastore/src/datastore.rsget_events_inner, called from aw-query/src/functions.rsquery_bucket.)
categorize() then runs only on those events. Growing the historical database does not add regex work to a month query. What would make a month view slower is more events in that month, more distinct app/title pairs, or more category rules.
The cache makes categorization scale with distinct app/title combinations in the period, not with raw event count or total DB size. The RAM bump you saw (20 MB → ~100 MB) is loading that month's events into memory, not the 168 MB sqlite file.
If a month view starts timing out again because the period itself gets denser, that's a useful report — but total DB size alone shouldn't bring it back.
While trying to view my activity for 2026-06 at http://localhost:5600/#/activity/your_hostname_here/month/2026-06-01/view/summary
I get
AxiosError: timeout of 30000ms exceeded. See dev console (F12) and/or server logs for more info.and my views hang with "Loading..." in them. Nothing particularly interesting after pressing F12.This is kind of a wish than a bug: Could ActivityWatch be made so that it doesn't start to time out on reports when there is more data in the database? I remember watching 1 month time periods without problem earlier on.