leekelleher / umbraco-contentment

Contentment for Umbraco - a state of happiness and satisfaction
https://marketplace.umbraco.com/package/umbraco.community.contentment
Mozilla Public License 2.0
157 stars 72 forks source link

Umbraco Cloud/Deploy - Suspect missing routing of nodes after Content Transfer #115

Closed bjarnef closed 3 years ago

bjarnef commented 3 years ago

What is the current behaviour?

Sometimes when deploying content on Umbraco Cloud projects I have noticed some nodes from time to time are loosing the routing, so accessing the page returns 404 and no link in backoffice.

When this happens I can usually just make a new deployment and all it good again.

What is the expected behaviour?

Existing nodes should still be routed. I have seen this behaviour on three different Umbraco Cloud projects all using Contentment v1.4.3

So I really wonder if this is caused by something by Contentment. In fact I haven't noticed in on other Umbraco Cloud project not using Contentment and on one on the projects I didn't had this issue until Contentment was installed.

I originally reported in here: https://github.com/umbraco/Umbraco.Cloud.Issues/issues/369

But just noticed on a project today, where link to some employee pages was broken. Made a whitespace, re-compiled and deployed again and all was working again.

https://github.com/umbraco/Umbraco.Cloud.Issues/issues/369#issuecomment-837173297

Just wondering if the FakeController here: https://github.com/leekelleher/umbraco-contentment/blob/master/src/Umbraco.Community.Contentment/DataEditors/ContentBlocks/ContentBlocksViewHelper.cs

could conflict with the one in Umbraco core: https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Web/Mvc/ControllerExtensions.cs

or maybe something in Contentment isn't registred after some Umbraco dependencies? πŸ•΅οΈβ€β™‚οΈπŸ€·β€β™‚οΈ

Please tell us about your set-up:

leekelleher commented 3 years ago

Thanks @bjarnef.

These sorts of issues with packages and Umbraco Cloud/Deploy are like trying to boil an ocean. 🀷 Where to start? Where to point the finger of blame! πŸ€ͺ

re FakeController - what lead you to think it's that? I'm totally happy to rename it, since it's an private nested class. But I'm not convinced that is the cause of the issue.

If the issue happened every time, (without content transfers), then we could probably pinpoint it easier.

My gut feeling / guess, is there could be a dependency for one of the Contentment data-types that isn't being transferred along with the content. Causing an issue on the other side, ultimately causing the 404 error. πŸ€”

I haven't used Cloud or Deploy in the past couple of years, so not sure how I'd go about testing/resolving issues like this. 🀷

bjarnef commented 3 years ago

I agree it can be hard to track down and definately not to blame Contenment. I love this package and a really nice way to enhance Umbraco with less code and a real time saver πŸ˜‹β˜€οΈπŸ˜Žβ€

The reason I thought it could be something with FakeController is that Umbraco has one as well here https://github.com/umbraco/Umbraco-CMS/blob/d428a4543f33bb7094cf7db5f6b6fdc2d1de3063/src/Umbraco.Web/Mvc/ControllerExtensions.cs

So just wondering if they could conflict with each other in some way πŸ€”

In fact in one of the projects I only have Contentment installed, but no datatypes using Contentment yet.

leekelleher commented 3 years ago

@bjarnef Thanks. Hope my blame comment didn't come across harsh, that wasn't my intention. Was more from my own past experience with Deploy + 3rd party packages.

I've renamed the fake controller class in commit 923e8ed762fd9e6a759bc32a294af941b3b0b77e. Tested that the Content Blocks preview still works okay, all good.

Currently this commit is in the v2.0 branch, I could look to backport it to a v1.4.4 patch next week - time permitting. My aim was to get v2.0 released asap, now that Umbraco v8.14 is out - in time for CodeGarden. πŸ˜ƒ

bjarnef commented 3 years ago

@leekelleher no, not at all. I just didn't want to blame you, but curious if it could be something with the FakeController.

In would be great with a v1.4.4 .. then I will be happy to test it further πŸ€“πŸ‘

leekelleher commented 3 years ago

"Fixed" in commit ed31f14a5c84a87363fc6fd6af4cf7de0642658c. Available in v1.4.4 patch release.

bjarnef commented 3 years ago

@leekelleher just to let you know, I got the same issue on a Umbraco Cloud project yesterday after deployment and using Contentment v1.4.3 .. added a whitespace and re-compiled dll and deployed again which solved the missing routes.

Afterwards I have upgraded to Contentment v1.4.4 and haven't noticed the missing routes since then.

leekelleher commented 3 years ago

@bjarnef Thanks for the update. Interesting though, I wouldn't have ever suspected something like a private controller name conflict causing an issue. Let me know if anything else odd happens (involving Contentment that is πŸ˜‰).

bjarnef commented 3 years ago

Yeah, I will keep an eye with it and see if the issue occurs again (maybe I was just lucky with the latest deployments πŸ€·β€β™‚οΈ).