Modules manipulating the domain and states in their setup should invalidate the depends cached properties
I realized that a problem with the cache invalidation could occur if a module manipulates the domain / states or whatever property of field given the fact that the depends properties computed from those are cached and not invalidated.
In python 3.8, it's not difficult to invalidate those: simply calling del field.readonly_depends
will invalidate the cache. But for python3.7 we're using the werkzeug implementation and it only supports using del
on werkzeug >= 2.0. For earlier version the idea I have is to use the set it with the _missing
value but it's quite ugly and depends on an implementation detail of werkzeug's cached_property.
(A very simple fix would be to turn those in simple properties and live with the performance penalty until we drop python3.7).