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

Dependencies of rep of same item are forgotten #1031

Closed
denisdefreyne opened this issue Dec 23, 2016 · 0 comments
Closed

Dependencies of rep of same item are forgotten #1031

denisdefreyne opened this issue Dec 23, 2016 · 0 comments
Milestone

Comments

@denisdefreyne
Copy link
Member

When an item has two representations, and one of those representations has dependencies that the other doesn’t, there can be a situation in which the dependencies for the other representation are forgotten.

Steps to reproduce

Given:

  • content/foo.md with content [<%= @items["/bar.*"].compiled_content %>]

  • content/bar.md with content 'I am bar!'

  • A rules file with content

     compile '/bar.*' do
       write '/bar.txt'
     end
    
     compile '/foo.*', rep: :default do
       write '/foo.txt'
     end
    
     compile '/foo.*', rep: :depz do
       filter :erb
       write '/foo_deps.txt'
     end

When:

  1. Site is compiled.
  2. The routing rule for the /foo.* item, :default rep, is changed to /foo-new.txt.
  3. Site is compiled.
  4. The contents of content/bar.md are changed
  5. Site is compiled.

Then:

  • The contents of output/foo_deps.txt are expected to reflect the new content of content/bar.md, but instead still contains the old content.

Expected behavior

Item is deemed as outdated, and thus recompiled.

Actual behavior

Item is not recompiled.

Details

The cause is likely

outdated_items.each { |i| @dependency_store.forget_dependencies_for(i) }

which only works when all reps of a given item are recompiled.

@denisdefreyne denisdefreyne added this to the 4.4.5 milestone Dec 23, 2016
denisdefreyne added a commit that referenced this issue Dec 23, 2016
…dated-items

Recompile all reps of outdated items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant