• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

refinery / refinerycms / 4114 / 19
95%
master: 95%

Build:
DEFAULT BRANCH: master
Ran 31 Aug 2020 01:00AM UTC
Files 137
Run time 7s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

31 Aug 2020 12:52AM UTC coverage: 82.82%. Remained the same
2.5, DB=mysql EXTENSION=images

push

travis-ci-com

web-flow
fix fragment caching for deleting page (#3480)

Hey,

we discovered some strange behaviour in our live application. If an refinery admin deletes a specific page, the fragment caching cannot resolve the caching to the right pages. We found a specific setup which always fails. You can see it in the Test Setup section. The main problem is, that we can't reproduce it in the refinery spec tests. To fix this issue, we updated the collection caching part. 

In the Error Output ActiveSupport::Cache.retrieve_cache_key section you can see the strange behaviour of mapping the cache to the wrong refinery_page.


## Test Setup

```ruby
    setup do
      # delete all refinery pages and create a root page
      ensure_only_homepage!

      page_first = Refinery::Page.root
      page_second = create(:refinery_page, title: 'Parent Page second')
      
      page_second.children.create(title: 'Second Parent Page First Child')
      page_second.children.create(title: 'Second Parent Page Second Child')

      @delete_me = page_first.children.create(title: 'Delete Me Page')

      sign_in_to_cms
    end

    should 'delete an existing page' do
      with_caching do
        visit refinery.admin_pages_path

        refinery_page = @delete_me
        assert has_content? refinery_page.title
        find("#page_#{refinery_page.id} .delete_icon", match: :first).click
        page.accept_alert

        Refinery::Page.all.map(&:title).uniq.each do |title|
          next if title.blank?
          assert has_no_text?(title, minimum: 2)
        end
      end
    end
```

## Error Output ActiveSupport::Cache.retrieve_cache_key

```ruby
# ActiveSupport::Cache.send(:retrieve_cache_key, child_page.self_and_descendants)
# -> "refinery/pages/query-0dee4f65ed115ac80776d3631787c654-1-20200728075715363993"
# pages/app/views/refinery/admin/pages/_page.html.erb:51
<%= render(partial: 'page', collection: page.children, cached: ->(child_page) { ch... (continued)

2015 of 2433 relevant lines covered (82.82%)

10.49 hits per line

Source Files on job 4114.19 (2.5, DB=mysql EXTENSION=images)
  • Tree
  • List 0
  • Changed 29
  • Source Changed 0
  • Coverage Changed 29
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 4005
  • Travis Job 4114.19
  • b41118ed on github
  • Prev Job for 2.5, DB=mysql EXTENSION=images on master (#4110.19)
  • Next Job for 2.5, DB=mysql EXTENSION=images on master (#4115.19)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc