Commit cd5aafe
authored
fix(settings): prevent categorization crash when hostname not yet resolved (#759)
* fix(settings): prevent categorization crash when hostname not yet resolved
The CategoryBuilder's fetchWords() could run before the hostname was
resolved (race condition with QueryOptions component), causing it to
construct invalid bucket IDs like 'aw-watcher-window_undefined' and
display "Unable to find bucket matching" errors.
Fix: bail out of fetchWords() if no valid hostname is available yet.
The queryOptions watcher will re-trigger fetchWords() once QueryOptions
emits a valid hostname, so the data loads correctly without errors.
Fixes ActivityWatch/activitywatch#1182
* fix(settings): reset loading state on early return when hostname unavailable1 parent c32b635 commit cd5aafe
1 file changed
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
201 | 205 | | |
202 | 206 | | |
203 | 207 | | |
| |||
0 commit comments