Fix Assertion Error on Page.update()
Duplicate Check
- [x] I have searched the opened issues and there are no duplicates
Describe the bug
Everytime am trying to update my ui through different threads, i run into the same error it doesn't matter which control, all of them do the same thing especially in this latest flet version 0.27.1
Code sample
Code
[Paste your code here]
To reproduce
File "C:\Users\Jovanne\AppData\Local\Programs\Python\Python313\Lib\site-packages\flet\core\page.py", line 732, in update r = self.__update(self) File "C:\Users\Jovanne\AppData\Local\Programs\Python\Python313\Lib\site-packages\flet\core\page.py", line 798, in __update commands, added_controls, removed_controls = self.__prepare_update(*controls) ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^ File "C:\Users\Jovanne\AppData\Local\Programs\Python\Python313\Lib\site-packages\flet\core\page.py", line 814, in __prepare_update control.build_update_commands( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ self._index, commands, added_controls, removed_controls ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "C:\Users\Jovanne\AppData\Local\Programs\Python\Python313\Lib\site-packages\flet\core\control.py", line 480, in build_update_commands ctrl.build_update_commands( ~~~~~~~~~~~~~~~~~~~~~~~~~~^ index, ^^^^^^ ...<3 lines>... isolated=ctrl.is_isolated(), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "C:\Users\Jovanne\AppData\Local\Programs\Python\Python313\Lib\site-packages\flet\core\control.py", line 480, in build_update_commands ctrl.build_update_commands( ~~~~~~~~~~~~~~~~~~~~~~~~~~^ index, ^^^^^^ ...<3 lines>... isolated=ctrl.is_isolated(), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "C:\Users\Jovanne\AppData\Local\Programs\Python\Python313\Lib\site-packages\flet\core\control.py", line 496, in build_update_commands assert self.__uid is not None ^^^^^^^^^^^^^^^^^^^^^^ AssertionError
Expected behavior
No response
Screenshots / Videos
Captures
[Upload media here]
Operating System
Windows
Operating system details
Windows 10
Flet version
0.27.1
Regression
No, it isn't
Suggestions
No response
Logs
future:
Additional details
No response
Please share repro code.
A similar error occurred to me: ERROR - AssertionError: _process_remove_command: control with ID '_6690' not found. It was captured by my logger. As far as I understand, this happens when the user navigates to another route. I didn't encounter such errors on version 0.24.1, for example. Just FYI.
Will be nice if you could comeup with some code repro of the issue.
I'm not sure if you'll be able to reproduce it on the first try, it happens from time to time. My code is too complex to provide and has some confidential data. @HappyCoder256, maybe you can provide some code to reproduce this issue?
Let me create a sample to reproduce that