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
ddfreyne opened this Issue Dec 23, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@ddfreyne
Member

ddfreyne commented Dec 23, 2016

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.

@ddfreyne ddfreyne added this to the 4.4.5 milestone Dec 23, 2016

@ddfreyne ddfreyne closed this in #1032 Dec 23, 2016

ddfreyne added a commit that referenced this issue Dec 23, 2016

Merge pull request #1032 from nanoc/gh-1031-recompile-all-reps-of-out…
…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