jmix-framework / jmix

Jmix framework
https://www.jmix.io
Apache License 2.0
604 stars 122 forks source link

Correct implementation of applying the dynamic attributes' schema changes #3721

Open fractal3000 opened 3 weeks ago

fractal3000 commented 3 weeks ago

Currently there are no any correct way to prepare the dynamic attributes schema changes and to apply them entirelly, at one moment.

This problem is caused with the fact that current process of using the dynamic attributes based on using a cache with such attributes' definitions. This cache contains all metada of the dynamic attributes. Cache entries are created and are putted into the cache during their recieving. Current impementaion of the "Apply changes" action just evicts this cache and do nothig else.

So there are possibilities that the new created attribute can be accessible without any applying new changes because the cache haven't contained it before the accessing.

If it could be possible to isolate new shema changes we have a chance to perform the applyinig process more strictly. In this case we can create and publish the event of shema change.

The ability to handling such event is important(for example) for synchronizing index schemas in the "Search" add-on. This ability might be important for solving this problem https://github.com/jmix-framework/jmix/issues/3720

Additionally currently there is a bug that user can see the not applied changes as having been applied.

fractal3000 commented 3 weeks ago

The suggestion is to store not applied changes in a separate tables.