-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
ContentService returns outdated result #2997
Comments
Looks like I forgot to update this issue 🙈 but a lot of discussion has been going on here: I've marked this as "Up for grabs" so that you or someone else coming along could create a pull request for it. |
That's a tad misleading when you closed the PR while waiting for @zpqrtbnk to investigate ? 😄 |
lol.. I missed my own last comment! I'll discuss with @zpqrtbnk or @Shazwazza |
thanks 😆 |
Sounds like @Shazwazza knows what to do with the CacheRefreshers - I've asked him to either do a fix or reply on how to fix! |
Great, thanks a lot 👍 😃 |
I hope this bug will get fixed soon (both Umbraco 7 and 8). It bit me badly today. Until it's fixed, here's a work around:
|
This item has been added to our backlog AB#1280 |
I've looked into this, and have some Cache at the repository layer means the two repos have their own caches which are not "synch'd". Super difficult to unravel. Cache at the repository layer is very problematic due to stale/invalidation issues such as this. It seems that it was implemented due to performance problems with either inefficient SQL queries, and/or excessive layers of abstraction. A better long term solution is to remove the caching from repositories. Then add the cache at a higher layer in a way that you can switch it on and off. Right now there is an arbitrary 5min timeout. I will look at a paper over the cracks solution to this issue in the mean time. |
I looked into this, and there is a temporary paper over the cracks fix for this. The instantiation of the default cache policy can be done from a shared static method. Is this acceptable? |
The fix for this is in the cache refreshers, we do no need to touch anything at the repository level. I plan to look into this today but will report back soon if other changes are needed. |
PR is here #6462 |
…-refresher Fixes #2997 - ContentService returns outdated result
Hi, really minor, as this in in a point release anyway, but I think this should be marked as a breaking change, as the fix changes the signature of the JsonPayload constructors for content and other items.. |
@Shazwazza, if we reintroduce the ctor's of signature |
@KevinJump thanks for flagging this 🙌 It's marked as breaking for now, as it is breaking in the RC, but we're looking into making it non-breaking for the final 8.4 release. |
Sure, i've put back in the orig constructor but using it will result in this bug not being fixed. The orig ctor is marked as obsolete. See commit 2ec5a81 |
When getting content through ContentService.GetById(guid) the returned result will be a cached version that is the first version from that app restart.
Using the normal/older ContentService.GetById(int) returns the up-to-date result
This can be reproduced by comparing the two results after performing a change on a node, which should have resulted in a new version being created.
Using the Guid version:
Using the int version:
This was tested on Umbraco v. 7.12.2
The text was updated successfully, but these errors were encountered: