Composite column values are cached in the db layer. If the underlying data is changed then db.cache.clear_caches() should be called to tell the composite evaluator to re-evaluate the column on next use. Looking at the annotations code in cache, this isn't happening.
I see 3 choices:
- Do nothing. The caches will be cleared from time to time because of other operations.
- cache.clear_caches() whenever the annotations change. This is a rather large hammer.
- When annotations change, loop through the fields (columns) and clear the render cache for composites. This is a smaller hammer but requires more work to set up the loop.
A more targeted solution would be not to use a custom column for annotation count, instead calling the function directly. This avoids caching but requires that the processing be done on-demand. @Comfy.h: this might be possible depending on how your action chains work. Instead of referencing the a custom column to get the count, call the function directly.