Closed (fixed)
Project:
Drupal core
Version:
9.5.x-dev
Component:
aggregator.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 May 2021 at 18:40 UTC
Updated:
19 Jul 2023 at 22:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
quietone commentedThe
aggregatormodule has been removed from Core in10.0.x-devand now lives on as a contrib module. Issues in the Core queue about theaggregatormodule, like this one, have been moved to the contrib module queue.Comment #4
larowlanComment #5
dcam commentedI verified that this is still an issue. The steps to reproduce it worked for me.
Comment #6
dcam commentedThis test demonstrates the bug by requesting
/aggregator, updating feed items, then requesting/aggregatoragain. The test fails correctly on my local.Unfortunately, the test is no good because I think it will invalidate the assertions that follow it. Those assertions were added by #3273873: Aggregator page contents could be empty due to missing cache context and they depend on the page not being cached. They were a problem for getting a failing test though. Requesting
/aggregator?page=2causes/aggregatorto start working properly. I don't know enough to understand why that was happening, but I assume that requesting a different page's context somehow cleared the first page's context too. As a result, it took me a while just to get a failing test. I haven't figured out if the tests for both issues can go into the same method yet. Maybe if I delete all the items and then re-update the feed...Comment #7
dcam commentedComment #9
dcam commentedNevermind. That was easy to solve. All it needs is a cache clear before the next assertion. I verified that the cache context assertion is still working properly by undoing the fix from #3273873: Aggregator page contents could be empty due to missing cache context and testing it locally. It failed just like it's supposed to. Here's a good failing test.
Comment #11
dcam commentedThis passes and works for me locally.
Comment #12
larowlanI'm hoping to review this tomorrow
Comment #13
larowlanInstead of this, we *should* be able to just call $feed->save(), because the Aggregator item includes 'aggregator_feed_list' in its cache tags, saving a feed should invalidate the render cache.
Using drupal_flush_all_caches feels wrong, because effectively we're saying 'if we clear all caches does the correct thing show' which we know is the case. I think we want to instead test that saving a feed invalidates the listing.
Comment #14
dcam commentedYes, that change worked.
Comment #16
larowlanLooks good to me - thanks!
I'll cut a new release
Comment #17
dcam commentedThis can apply to the 1.x branch too. I just haven't fixed its tests yet. We could apply the patch without fixing the tests first. I ran them locally without and with the fix and got the same results that I did for the 2.x branch. But I was trying to do things properly.
Comment #18
larowlanYeah fine to backport we know tests on 1.x are in a bad place
Comment #20
dcam commentedIt passed for the 1.x branch too.
Comment #21
dcam commentedThis has been committed to contrib Aggregator. The patch in #14 can be rerolled for core, if anyone cares to do it.
Comment #24
rpayanmPlease review.
Comment #25
darren ohVerified on Drupal 9.5. Thank you!
Comment #26
longwave9.5 has perhaps seen its last bug fix release already, but for posterity let's get this in anyway.
Committed and pushed 3892aea923 to 9.5.x. Thanks!