You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are upgrading to 6.0 and stumbled over this issue. Unfortunately we are not yet on upstream (but hopefully soon) but from reading the code it seems that this is a problem of Alchemy and not our fork.
Happy to help with fixing this, please let me know if my proposed solution is the way to go.
Steps to reproduce
Disable background jobs, so thePublishPageJob is not running
Change content, save, publish page
Visit page: old content is server
Start background jobs, wait until PublishPageJob is processed
Visit page: still old content is server
I assume this is because upon publication Page#publish! is called, which updates the published_at timestamp and then defers the rest of the work to the (new) background job.
This timestamp is used when calculating etag/stale status of a page. So if a request is made between (depending on the load on the job queueu and the popularity of the page, this happening is quite likely) updating the timestamp and running the job, then the old page version is served with the new etag already.
Proposal: Moving the update of the published_at timestamp to the Publisher#publish would fix this, though i don't know if there are any unwanted consequences with this.
Expected behavior
Updated page content is served, once job has been processed
Actual behavior
Old page cpontent is served
System configuration
Alchemy Version: 6
Rails Version: 6.1
The text was updated successfully, but these errors were encountered:
pascalbetz
added a commit
to algrano/alchemy_cms
that referenced
this issue
May 5, 2022
ClosesAlchemyCMS#2330
Updating published_at only after a public PageVersion has been created or updated
to avoid e-tags being created with old PageVersion.
re-add Page#publish! since it was public interface
Hello Alchemy Team
We are upgrading to 6.0 and stumbled over this issue. Unfortunately we are not yet on upstream (but hopefully soon) but from reading the code it seems that this is a problem of Alchemy and not our fork.
Happy to help with fixing this, please let me know if my proposed solution is the way to go.
Steps to reproduce
PublishPageJob
is not runningPublishPageJob
is processedI assume this is because upon publication
Page#publish!
is called, which updates thepublished_at
timestamp and then defers the rest of the work to the (new) background job.This timestamp is used when calculating etag/stale status of a page. So if a request is made between (depending on the load on the job queueu and the popularity of the page, this happening is quite likely) updating the timestamp and running the job, then the old page version is served with the new etag already.
Proposal: Moving the update of the
published_at
timestamp to thePublisher#publish
would fix this, though i don't know if there are any unwanted consequences with this.Expected behavior
Updated page content is served, once job has been processed
Actual behavior
Old page cpontent is served
System configuration
The text was updated successfully, but these errors were encountered: