V17 - After publishing, model's complex properties come up empty

I’ve noticed something that is so big that I’m fearing I’m doing something wrong - and I really wish I am :slight_smile:
I’ve got a doctype with some block list properties in it. They come from several compositions, but I don’t think that’s relevant.

I had witnessed some weird behavior, so I debugged and I discovered that, while initially the model contains all block list properties with the correct count when they are filled, after a publish the model shows ZERO count for all block list properties. The only way to get the properties to show up again is to restart / rebuild the application.

At first I thought it was something weird I did, but I tested in in my master template with the Model itself - I’ve got some block lists there, some of them have content. First run - everything there. Publish and reload the page - primitive properties still there, blocks gone. That’s only on the front end - back office contains all blocks and data.

Tried it on 17.0.x, upgraded to 17.1.0, same behavior.

Am I missing something? I don’t believe this would have gone unnoticed for so long, so is it something in my setup or does it happen to you as well?

Self-solved, but it’s worth mentioning. I’m glad it was my setup and not an Umbraco bug since the magnitude would be huge :slight_smile:

On a notification handler, I had:
_umbracoContextFactory.EnsureUmbracoContext()

as soon as I changed that to

_umbracoContextAccessor.GetRequiredUmbracoContext()

everything worked. It looks like v17 is more strict on creating new contexts and gets confused somehow? Since this code has been there for ages, but it’s on v17 that it produced this effect. Anyway, I’m leaving this there in case it helps anybody else.