Clean up null values in datatype configs #16296
Merged
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
We're seeing
null
values for datatype configurations when migration older (V11?) databases to V14. It mostly seem to happen for empty array configurations, and it looks like theSystem.Text.Json
serializer doesn't know what to do with those.This is not happening for V13 databases. It seems like V13 does not store empty array config values.
The
null
values are particularly problematic for the default file upload editor (with no allowed types configured). The editor expects a non-nullable array of allowed file extensions, but the stored config value isnull
and thus the array is initialized with anull
value during deserialization. The result is a fine error message when attempting to upload a new file:To fix it, this PR adds a new migration to root out all
null
value configuration entries for all core datatypes.Testing this PR
It's a little tricky to test since it only happens in certain rare cases. But reach out to @kjac for a test DB and some instructions 😄