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

[Beta][Windows]: "request timeout" setting doesn't work #979

Closed
2 tasks done
PetbkA opened this issue Oct 31, 2023 · 4 comments
Closed
2 tasks done

[Beta][Windows]: "request timeout" setting doesn't work #979

PetbkA opened this issue Oct 31, 2023 · 4 comments

Comments

@PetbkA
Copy link

PetbkA commented Oct 31, 2023

  • I am on the latest beta v0.12.3b12 ActivityWatch version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • OS name and version: Windows 10 LTSC 2021 (version 21H2) x64 EN
  • ActivityWatch version: 0.12.3b11
  • Browser: Ungoogled Chromium 118.0.5993.118 x64 with AW site in Sites that can always use cookies list.

Describe the bug

It seems that Request Timeout parameter has stopped working. Can't get activities for 30 days period 'cause of 30 seconds timeout while it should be 300 seconds.

To Reproduce

  1. Go to Settings and change Request Timeout value from 30 to 300;
  2. Close all AW tabs and restart aw-server via tray;
  3. Open Activity screen and change time period to 30 days - NOK: AxiosError: timeout of 30000ms exceeded is raised, i.e. request timeout hasn't changed.

Expected behavior

Categories will be shown after some time, more than 30 seconds, but less than 300 (worked OK in beta v0.12.3b7).

Documentation

aw-server's logs are attached. There are some errors, although they don't appear right when timeout error is raised. After some retries you can get sqlite3.OperationalError: database is locked error which is hardly relevant to the bug:

2023-10-31 08:33:12 [ERROR]: Exception on /api/0/buckets/aw-watcher-afk_petbka/events [GET]  (aw-server:1414)
Traceback (most recent call last):
  File "peewee.py", line 3252, in execute_sql
sqlite3.OperationalError: database is locked

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "flask\app.py", line 1484, in full_dispatch_request
  File "flask\app.py", line 1469, in dispatch_request
  File "aw_server\rest.py", line 45, in decorator
  File "flask_restx\api.py", line 404, in wrapper
  File "flask\views.py", line 109, in view
  File "flask_restx\resource.py", line 46, in dispatch_request
  File "aw_server\rest.py", line 205, in get
  File "aw_server\api.py", line 46, in g
  File "aw_server\api.py", line 226, in get_events
  File "aw_datastore\datastore.py", line 115, in get
  File "aw_datastore\storages\peewee.py", line 363, in get_events
  File "peewee.py", line 1972, in inner
  File "peewee.py", line 2043, in execute
  File "peewee.py", line 2216, in _execute
  File "peewee.py", line 3260, in execute
  File "peewee.py", line 3252, in execute_sql
  File "peewee.py", line 3020, in __exit__
  File "peewee.py", line 192, in reraise
  File "peewee.py", line 3252, in execute_sql
peewee.OperationalError: database is locked
@PetbkA
Copy link
Author

PetbkA commented Oct 31, 2023

v0.12.3b12 - no changes, behavior as in beta 11. Updated issue description

@ErikBjare
Copy link
Member

Alright, so this is a tricky one.

It's caused by us switching to using server-stored settings, where the request timeout value is stored, but to access the settings we need aw-client initialized, which is where the timeout is passed in. Thus it ends up with the default timeout.

Fixing it now.

ErikBjare added a commit to ActivityWatch/aw-webui that referenced this issue Nov 15, 2023
@ErikBjare
Copy link
Member

Fixed in ActivityWatch/aw-webui@e05e805

Thanks for reporting!

@PetbkA
Copy link
Author

PetbkA commented Nov 17, 2023

v0.12.3b13 - fixed

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

No branches or pull requests

2 participants