This project is archived and is in readonly mode.
cache_sweeper yields blank output
-
Aaron
- Tag changed from cache_sweeper sweeper to cache, cache_sweeper, sweeper
-
Si
I'm seeing this too. Instead of running any code in the method, I get the following plus a blank screen:
Completed 200 OK in 717ms
I'm running:
ruby 1.9.2dev (2010-04-02 trunk 27189) [x86_64-darwin10]
Rails 3.0.0.beta2 -
Si
Looks like ActionController::Caching::Sweeper doesn't return true as a default when callbacks aren't run (!controller.perform_caching).
Including a patch.
-
Si
- Tag changed from cache, cache_sweeper, sweeper to cache, cache_sweeper, patch, sweeper
-
aaronchi
- Tag changed from cache, cache_sweeper, patch, sweeper to cache, cache_sweeper, patch, rails3, sweeper
-
Si
Now I'm pushing up to staging I see that the before filter will need to return true in all cases. This is because the sweeper filter aspect is really implementation detail, and sweepers shouldn't prevent actions running like regular filters can.
I've updated the patch.
-
Neeraj Singh
I am not able to simulate this problem in rails edge. Could you try to simulate this problem with rails edge and see if it is still an issue.
-
kevmoo
Reproduced on edge Ref: 6d7f2790cdb6cb232850, May 6, 2010
class MainController < ApplicationController
cache_sweeper :app_sweeperdef index end end
class AppSweeper < ActionController::Caching::Sweeper
end -
kevmoo
Verified Si's patch 'return_true_for_non_caching_sweeper_filter.diff' fixes the issue.
NO clue if this breaks anything else, but my page is loading.
-
kevmoo
...and I take that back. I added an after_save to the sweeper and we're back to the original issue -> blank output
-
Neeraj Singh
Attached is a patch with test. I was not really sure how to go about testing this one. So any feedback on testing strategy is welcome.
-
Si
Hi Kevmoo, I updated that patch but the fix is the same in Neeraj's diff. Can you try that?
-
Dan Pickett
- Tag changed from cache, cache_sweeper, patch, rails3, sweeper to bugmash, cache, cache_sweeper, patch, rails3, sweeper
-
marian (at bitflut)
- Tag changed from bugmash, cache, cache_sweeper, patch, rails3, sweeper to rails 3.0.0.beta4, bugmash, cache, cache_sweeper, patch, rails3, sweeper
Still there in rails 3 beta 4
-
José Valim
Applied, but still need better tests.
-
Repository
- State changed from new to open
(from [db23a95a616860e4fefa4ef83b396abe7ec0ea71]) cache_sweeper yields blank output
[#3914 state:open]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/db23a95a616860e4fefa4ef83b396a... -
Repository
- State changed from open to resolved
(from [f48aa14bf43fb103e5d128151061549ba6bb8c23]) Better test for ticket [#3914 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/f48aa14bf43fb103e5d12815106154...
