-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Do not mark unchanged computed var deps as dirty #4488
base: main
Are you sure you want to change the base?
Do not mark unchanged computed var deps as dirty #4488
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one potentially issue i see with this approach is it makes it harder to manually mark a var as dirty, for example if internal change tracking is not working for a certain kind of object, a hackaround was always to assign it to itself to signal to the framework that it should be included in the delta. i know @adhami3310 uses this trick quite a bit.
@masenf I knew this comment was coming 😆 However, I have 2 arguments against it:
|
I just refactored one small repo to always check if the var has changed before assignment. Now I have a diff of 85 lines with repetitive if self.var != new_var:
self.var = new_var |
haven't looked into this too deeply but |
current implementation is not optimal, i have a better one coming |
need to recheck order of computed var computation |
Merge remote-tracking branch 'origin/main' into unchanged-vars-dirty
It changed due to priming of the caches. I disabled it for now in cc6edf1 This broke some of our apps without failing reflex tests. Maybe we can add a test for it (order and count of computed var execution) Not sure why the last commit broke dynamic route var tests. My test project which I wrote while fixing var deps for dynamic args with @masenf still works fine. Maybe the test only needs adjustment. Need to investigate (I don't just want to change it without fully understanding it) |
@masenf can you test if your model recursion issue also occurs with a computed var in this PR? |
part of #4487