-
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
[BUG] V13.5.2 Cache issue: unpublished content can be reached #17393
Comments
Hi there @adavidovic92! Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better. We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.
We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
@adavidovic92 you can't rely on unpublished/published notifications, they can happen before nucache operations are finished, to get what you want working you need attach to cache refresher notification, check the whole thread here: |
@bielu @nikolajlauridsen Unfortunately, I need to reopen this issue for several reasons, specifically regarding version
In contrast, with version
In summary, after upgrading from |
@adavidovic92 ContentCacheRefresherNotification can be randomly trigger before or after ContentPublishedNotification, which is documented, so you actually cant use ContentTreeChangeNotification either, but ContentCacheRefresherNotification (which is confusing as hell, but it what you need to do when using notifications). the only reliable notification is CCRN, not any related to content tree or content publishing. |
@bielu Apologies for the confusion in my previous comment. I've corrected it now — I had originally used |
@adavidovic92 can you maybe share simplied version of your notitication handler? as it might be case of reusing previous umbraco context :) |
|
@adavidovic92 do you depend on Icontent? as I noticed you use Icontent service, to get fresh IPC you would need use
If you want do that in you customClient you still can use factory :) also it might be issue with scopes, you might want create separate subscope in DI to ensure you dont share context with main event context, as than it would use stale version of IPC (There is a lot weird things with scoping and context in umbraco :)) |
@bielu You see, the content item might not need to be used at all. It is enough to simply send a request to the Node.js server to clear all cache and fetch new data. However, the issue is that it still receives outdated data. |
@bielu In our context the content item is only used to construct the correct URL for the item that needs clearing — nothing more. The strange thing is that, within the |
@adavidovic92 do you any load balancing? as it might be loadbalacing issue not notification issue 🤔 |
@bielu No, we don't. This issue reproduces on a local machine with a clean Umbraco |
@bielu #17393 (comment) All of this was done on a local machine. |
@bielu This is a simple example of API endpoint for retrieving data which is used by Node.js server. Could the issue be related to
|
Tbh i never used IPublishedContentQuery as I found it hard to work with, so hard to say but I guess, could try wrap it with context factory and creating new context reference? or creating new snapshot wtih snapshot factory(I think it is how it was called)? |
@bielu thank you, I will try to check this variant 👍 |
@bielu Unfortunately, I’ve tried both factories and accessors, but the result is the same—the client only receives old data. The data is only up-to-date if I set a timeout of 2-3 seconds. |
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
13.5.2
Bug summary
It was discovered that when attempting to unpublish, there is a delay during which the unpublished content remains accessible.
We have implemented a custom published/unpublished notification handler that sends a request to the client to clear its cache, followed by a new request to Umbraco to retrieve and cache the latest published content. However, due to a delay where unpublished content remains accessible, it re-caches the old content. This issue wasn’t present in the previous 13.3.2 version.
Specifics
No response
Steps to reproduce
The video below showcases a clean Umbraco solution with a simple API endpoint and a custom published notification handler that calls this API endpoint. However, the endpoint returns outdated data instead of the latest updates:
TinyTake.by.MangoApps-29-10-2024-04-35-25.mp4
Expected result / actual result
When a custom published/unpublished notification handler is triggered the cache must be refreshed
The text was updated successfully, but these errors were encountered: