flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
9.43k stars 360 forks source link

Exception: Timeout waiting for invokeMethod clientStorage:get({'key': 'USERNAME'}) call #3131

Closed NooRMaseR closed 2 weeks ago

NooRMaseR commented 2 weeks ago

Exception: Timeout waiting for invokeMethod clientStorage:get({'key': 'USERNAME'}) call

hi, i have an issue here since i have updated to flet:0.22.0 when i run the app i get this error when using this code page.client_storage.get() like this

class ChatUI(ft.SafeArea):

    def __init__(self, window: ft.Page) -> None:
        super().__init__()
        self.window: ft.Page = window
    self.username: str = (
            "User"
            if not self.window.client_storage.get("USERNAME") 
            else self.window.client_storage.get("USERNAME") 
        )

and i get this error

exception calling callback for <Future at 0x25512a56870 state=finished raised TimeoutError>
Traceback (most recent call last):
  File "C:\Users\workstation\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\_base.py", line 340, in _invoke_callbacks 
    callback(self)
  File "C:\Users\workstation\AppData\Local\Programs\Python\Python312\Lib\site-packages\flet_core\page.py", line 519, in _on_completion
    raise exception
TimeoutError: Timeout waiting for invokeMethod clientStorage:get({'key': 'USERNAME'}) call
Unhandled error processing page session : Traceback (most recent call last):
  File "C:\Users\workstation\AppData\Local\Programs\Python\Python312\Lib\site-packages\flet_easy\route.py", line 261, in _go
    self.__page.run_task(self._view_append, route).result()
  File "C:\Users\workstation\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\_base.py", line 456, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\workstation\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\_base.py", line 401, in __get_result
    raise self._exception
  File "C:\Users\workstation\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\_base.py", line 340, in _invoke_callbacks       
    callback(self)
  File "C:\Users\workstation\AppData\Local\Programs\Python\Python312\Lib\site-packages\flet_core\page.py", line 519, in _on_completion      
    raise exception
TimeoutError: Timeout waiting for invokeMethod clientStorage:get({'key': 'USERNAME'}) call

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\workstation\AppData\Local\Programs\Python\Python312\Lib\site-packages\flet_runtime\app.py", line 242, in on_session_created
    await asyncio.get_running_loop().run_in_executor(
  File "C:\Users\workstation\AppData\Local\Programs\Python\Python312\Lib\concurrent\futures\thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\workstation\AppData\Local\Programs\Python\Python312\Lib\site-packages\flet_easy\fletEasy.py", line 175, in main
    app.run()
  File "C:\Users\workstation\AppData\Local\Programs\Python\Python312\Lib\site-packages\flet_easy\route.py", line 142, in run
    self._go(self.__page.route)
  File "C:\Users\workstation\AppData\Local\Programs\Python\Python312\Lib\site-packages\flet_easy\route.py", line 273, in _go
    raise Exception(e)
Exception: Timeout waiting for invokeMethod clientStorage:get({'key': 'USERNAME'}) call

i get no errors when using set instead of get

Operating System: Windows 10