Closed douglasg14b closed 8 months ago
Strange, I don't see how that could happen given the code:
const words = {};
for (const event of events) {
const words_in_event = event.data.title.split(/[\s\-,:()[\]/]/);
for (const word of words_in_event) {
if (word.length <= 2 || this.ignored_words.includes(word)) {
continue;
}
if (word in words) {
words[word].duration += event.duration;
words[word].events.push(event);
} else {
words[word] = {
word: word,
duration: event.duration,
events: [event],
};
}
}
}
words
should always have a events
, and we check if word in words
, so... :man_shrugging:
Looks like the code hasn't changed since v0.12.2 either, so probably not something that a newer version would fix.
Maybe there is a strange Nah, no way.word
in words_in_event
? The word.length <= 2
will return false for any non-strings, for example. But split
would never do that...
I played a bit with the code just to try and figure it out, but it all looks right to me... I ended up improving the common string algorithm to also include common bigrams: https://github.com/ActivityWatch/aw-webui/pull/455
Still no clue how this bug could happen though.
I was only able to repro this with a fresh setup, now that there is more than a day of data it doesn't seem to crop up 🤔
@ErikBjare I would recommend some defensive programming around this, and validating that the events
property of each value actually exists wherever it is they are pulled or created from. And then logging contextual errors if it's missing. This can greatly assist with finding the bug source in the future.
Any solution? I installed it yesterday as a new user, and this bug is also happening to me.
Hi, marvelous developer, I installed AcitvityWatch earlier today, and I have the same issue: Category builder doesn't work, just shows loading perpetually. Is there any solution for it as of now?
So the way i fixed this could also solve it for other. -Go to category builder. -Press Show Options. -Select a different host name.
as i understand my issue was related to having an old watcher that i wasnt using and was deleted but was still showing in the list of hosts. Picking the new host solved the problem for me.
@Qemuel8 Good observation!
The categorization helper currently assumes which hostname is the target, but it can be changed by clicking "Show options" and choosing the correct host in the dropdown.
I'll work on these bad assumptions.
Fixed now, see https://github.com/ActivityWatch/activitywatch/issues/965#issuecomment-1817986172
Thanks for reporting!
Describe the bug
Just installed and setup ActivityWatch and after a day of work went to setup categories. Category builder doesn't work, just shows
loading
perpetually. When it loads, the following error shows in console:Which is thrown from here: https://github.com/ActivityWatch/aw-webui/blob/1f194ff6886d82ac5928e8cb944888d378c54157/src/views/settings/CategoryBuilder.vue#L227
To Reproduce
Unknown, happens every time
Expected behavior
It doesn't fail, and loads categories
Documentation
The date range selection appears to be borked? Inconsistent date offsets/not using UTS everywhere?
Additional context
Watchers: