Closed podliashanyk closed 2 weeks ago
Please add where 2, 3 and 4 happens.
Updated steps to reproduce
Similar: if testing and turning off the locally running server while logged in, then starting the server again, we now first get "Could not establish connection to UpdateHandler" followed by:
Traceback (most recent call last):
File "/../.virtualenvs/howitz/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
File "/../.virtualenvs/howitz/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/HOME/../howitz/src/howitz/endpoints.py", line 515, in refresh_events
removed_events, modified_events, added_events, event_list = refresh_current_events()
File "/HOME/../howitz/src/howitz/endpoints.py", line 255, in refresh_current_events
table_events = get_sorted_table_event_list(current_events)
File "/HOME/../zino/howitz/src/howitz/endpoints.py", line 189, in get_sorted_table_event_list
for c in events_sorted.values():
AttributeError: 'NoneType' object has no attribute 'values'
The first error is triggered by not being authenticated.
The second exception (AttributeError) happens because there are no events in the cache.
current_events = current_app.cache.get("events")
, current_events is None. At this point we need to rebuild the entire list anyway. Either:
Description
After successful re-connect only "read" operations work on events (like get attrs. logs etc), but "write" operations don't work (like update status, poll etc). All operations work as expected again after a manual page reload.
To reproduce:
handle_lost_connection()
Expected behaviour:
If re-connect was successful, all operations should work as expected without the need for manual page reload.
Context: