Skip to content
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

Paginated comments cache not purging when comment is posted #336

Closed
raamdev opened this issue Sep 25, 2014 · 7 comments
Closed

Paginated comments cache not purging when comment is posted #336

raamdev opened this issue Sep 25, 2014 · 7 comments
Labels
Milestone

Comments

@raamdev
Copy link
Contributor

@raamdev raamdev commented Sep 25, 2014

@bridgeport writes (in #335)...

So, I have a post with comments spread across two pages. The cache structure is as follows:

/topic.html
/topic/comment-page-1.html

When a comment is added, edited, or trashed, the "topic.html" file is purged, but not the file within the "topic" folder. Whether I'm updating or adding a comment (as editor or administrator) the folder does not purge.

I don't know if it's appropriate for me to post these comment purge issues here (in this false report issue). If necessary I can open a new topic while this one can be closed.


I have confirmed this bug in both v140829 and v140925 (Release Candidate).

@jaswsinc This was supposed to have been fixed in #75 after your work on the branched cache structure. If you have any insight into what might be going on here, that would be helpful. :)


Steps to reproduce this bug

  1. Enable Quick Cache, ensure that manual approval is required for new comments (Dashboard → Settings → Discussion)
  2. As a logged-out user, visit a post that includes multiple pages of comments; visit each page of comments to generate cache files for those pages (should create cache files like %postname%/comment-page-1.html, %postname%/comment-page-2.html, etc.)
  3. As a logged-out user, post a new comment on that post
  4. As an administrator, approve the new comment; this should cause Quick Cache to purge not only the cache file for the post where the comment was posted, but also any associated cache files for the paginated comment pages (%postname%/*).

Instead, what happens is only the cache file for the post itself gets purged--none of the paginated comment page cache files are purged.

@jaswrks
Copy link

@jaswrks jaswrks commented Sep 25, 2014

Confirmed also. This appears to be caused by an invalid regex pattern in QC and QCP. The following pattern, which occurs in several places within the codebase...

(?:\/index)?(?:\.|\/(?:page|comment\-page)\/[0-9]+[.\/])

Should be...

(?:\/index)?(?:\.|\/(?:page\/[0-9]+|comment\-page\-[0-9]+)[.\/])

QC currently expects the permalink structure to be: comment-page/[page], when in fact it is actually comment-page-[page]. This was a mistake on my part. The normal pagination uses page/[page], but comments use a different structure. I did not realize this until you reported it here.

I will open a pull request shortly to correct this issue.

jaswrks pushed a commit that referenced this issue Sep 25, 2014
… paginated comments are picked up properly in all cases. See: #336
jaswrks pushed a commit to wpsharks/comet-cache-pro that referenced this issue Sep 25, 2014
… paginated comments are picked up properly in all cases. See: wpsharks/comet-cache#336
@jaswrks
Copy link

@jaswrks jaswrks commented Sep 25, 2014

Testing the changes that I just submitted. I will report back shortly.

@jaswrks
Copy link

@jaswrks jaswrks commented Sep 25, 2014

I can confirm this issue is fixed by the pull requests I submitted above.

@raamdev
Copy link
Contributor Author

@raamdev raamdev commented Sep 26, 2014

@jaswsinc Thank you. Since the fix for this bug was obvious, I'm going to go ahead and pull this into the current Release Candidate branch (release/140925) so that it can go out with the next release, which should take place in the next few days.

@raamdev raamdev modified the milestones: Next Release, Future Release Sep 26, 2014
@raamdev
Copy link
Contributor Author

@raamdev raamdev commented Sep 26, 2014

@bridgeport This has been fixed and the next release will include this bug fix. Thank you again for reporting this! :)

@raamdev
Copy link
Contributor Author

@raamdev raamdev commented Sep 26, 2014

Closed by PRs #338 and wpsharks/comet-cache-pro#86.

@raamdev raamdev closed this Sep 26, 2014
@raamdev
Copy link
Contributor Author

@raamdev raamdev commented Sep 26, 2014

Next release changelog:

  • Bug Fix: When a new comment is posted, Quick Cache now properly purges the cache files for any paginated comment pages. See #336.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants