Ensure content types are updated in ContentStore when a data type changes #15239
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites
Description
Whenever one makes changes to a data type, these changes are immediately available in the published properties that are based on this data type. That is, until a piece of content with a property based on this data type is either saved or published; then the data type data is rolled back to the previous version on all published properties of all content using this data type.
This can be reproduced by printing out the max allowed chars on a text string configuration:
Steps 2 and 3 can be repeated over and over with the same result. Only a site restart resolves the problem.
While the above is quite the edge case, this issue becomes a whole lot worse for block based editors. They use the published property data type configuration to determine which blocks to include in output (for validation purposes). If a block is added to the data type configuration and a page is subsequently saved (or published), all blocks of this new type are simply stripped from the output. Or even worse, if a block is removed... all blocks of this type will re-appear after a page is saved.
The following template can be used to perform the test scenario: