-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Item with ID cannot be deleted because it is not found in Sitecore 9.2+ #402
Comments
@mikeedwards83 any thoughts on @markgibbons25 suggestion? We are facing the same problem and this is filling up our prod trace logs massively. Thanks for your help! |
@swissworx Sorry for not responding quicker. This is indeed annoying, my only worry is that the item just hangs around in memory and cause a memory leak if delete isn't called. Is there a way to tell if the item is removed from memory without the delete? |
It looks to me like it is going to get cleaned up by the GC just fine. Which leads me to think that we could maybe improve performance here by pooling and reusing these fake items to save the GC some work. |
We've seen the same behaviour in one of our projects. When could we expect this update to be published on NuGet? Thanks! |
I would love to but it's up to @mikeedwards83 |
@mikeedwards83 it looks fine to me, I quickly cracked the Sitecore dll open and I couldn't find anything being allocated that is not cleaned up by the GC. |
Thanks, I will make the change later today and push a beta nuget out.
|
Adds a DeleteRenderingParametersItems flag to allow backward compatibility
I have pushed a beta release with this fix, it also contains a flag in the config for backward compatibility. By default it will no longer delete the item, but setting the flag will restore the original logic. |
We are getting our logs spammed with messages like
I traced it back to here
Glass.Mapper/Source/Glass.Mapper.Sc/RenderingParametersModelFactory.cs
Line 50 in 2bc3e94
I added a log statement
Sitecore.Diagnostics.Log.Info("GLASS DELETE?", this); item.Delete(); //added for clean up
And confirmed logs:
It looks like Sitecore in 9.2+ has changed that Delete() to log if the item is not found.
Looks like in this case it is an in memory item only.
Is it safe to just remove that item.Delete() line and let the GC do its thing?
Happy to open a PR if so.
The text was updated successfully, but these errors were encountered: