Skip to content

Caching bug with template inheritance #206

@David-Mulder

Description

@David-Mulder

Ok, so I am not sure of all terminology and everything (pretty new to mustache still), but I was able to boil it down to a pretty small test case that shows the functionality

Express

router.get('/a', function(req, res) {
    res.render("A");
});
router.get('/b', function(req, res) {
    res.render("B");
});

A.mustache

{{<C}}
     {{$C}}
          A
     {{/C}}
{{/C}}

B.mustache

{{<C}}
     {{$C}}
          B
     {{/C}}
{{/C}}

C.mustache

{{>D}}
C: {{$C}}{{/C}}

D.mustache

D: {{$C}}{{/C}}

Now, load up /a and then /b, the first will output D: AA C: AA as expected, the second D: AA C: BB, now reload node.js and load up /b first and then /a and you get the exact opposite (D: BB gets 'stuck'). I have tried figuring this one out myself, but I got lost in the source code entirely.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions