question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enum DataType with no selection results in extremely large serialised data for Umbraco

See original GitHub issue

Which 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: image

image

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:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
robertjfcommented, Mar 9, 2022

oh, and yes, the Block List Editor, correct.

0reactions
leekellehercommented, Mar 9, 2022

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

enum or dictionary like data type in umbraco
Hello everybody,. I was wondering if anybody out there knows if there's a Data Type in Umbraco (a package, custom implementation, example, ...
Read more >
how to create a custom dropdown datatype with non ...
How to create a custom dropdown datatype with non integer option values. Extending Umbraco. Hi, I am trying to create a custom dropdown...
Read more >
Composing - Umbraco CMS
These properties are based on the Data Types which are used by the Document Type. It will show up in the dropdown by...
Read more >
Our Umbraco Search json
Hi all, Is there a friendly way to serialize an IPublishedContent node to a Json format, without having to map into a model...
Read more >
Feedback on "Packages in Umbraco 9 via NuGet" #10411
This file will be exportable from the Umbraco packages section based on data selected. For the most part, the file format will not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found