Enum DataType with no selection results in extremely large serialised data for Umbraco
See original GitHub issueWhich Contentment version are you using?
3.1.0
Which Umbraco version are you using? For example: 8.14.1 - don’t just write v8
9.3.1
Bug summary
We are building a site that implements the Umbraco Content Blocks datatype for many pages, and recently we’ve hit upon an issue when saving one of the pages where the green Save/Submit button goes from the busy state to a green error state ('X).
Investigating in DevTools showed that the controller was returning a 413 error, consistent with this issue - New default 30 MB (~28.6 MiB) max request body size limit back in 2017. When inspecting the headers, the content-length
was 33581128 bytes, or over the 30MB limit of the default max request body size.
Further inspection of the call by setting breakpoints in the code and rendering the data out with Utilities.toJson
resulted in a string size of 33.6 MB
!
I was able to download and inspect the json file, and the only abnormality was this:
{
"contentTypeKey": "07a02735-44df-48f1-a572-1212cfb2b7e4",
"udi": "umb://element/e3f318e96ba143de883df144b6bebe48",
"justify": ""\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"Center\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\"\\\"\"",
""underlinedText": "",
"underlineColour": {
"value": "ff80a9",
"label": "Love",
"sortOrder": 3,
"id": "4"
},
"underlineStyle": ["ChalkLine1"],
"blockPartitionStyle": ""
}
the extra \
in the justify data occurred twice, and when I deleted the data only out, the file size dropped from 32MB to 38kb.
It looks like when the data is written back, there’s an issue where it’s being incorrectly serialized/deserialised, and each save is compounding the problem. The data probably should be just "Center"
in the example above.
Here’s the configuration of the enum data type:
Steps to reproduce
See above.
Expected result / actual result
No response
Do you have Umbraco ModelsBuilder enabled?
- Yes, it is enabled.
What browsers are you seeing the problem on?
Chrome, Microsoft Edge
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
oh, and yes, the Block List Editor, correct.
@robertjf Okay, glad to hear that it seems to be working now. 👍 I’ll close off this issue for now, but if it creeps up again please do feel free to re-open it. Bit concerning if there’s a 30Mb+ JSON payload happening somewhere. 😬 Thanks again for reporting it.