Skip to content

Linux: fs.writeFile() can result in empty reads for external watchers due to truncation #4727

@jandrieu

Description

@jandrieu

Steps to Reproduce:

  1. Open known good partial (dust template), e.g, the menuItem.toggle.dust.emacs attached
  2. Add and delete a space, then save.
  3. Re-run dust rendering

The output will be missing several elements. Given the dust template I'm using, I believe it may be a failure in the eq test. BUT I know this isn't a Dust.js problem because it works if I save it from emacs:

Steps to fix:

  1. Open partial saved above, e.g., the menuItem.toggle.dust.code attached, in a good editor, e.g., emacs.
  2. Add and delete a space, then save
  3. Re-run dust rendering.

The output will be as expected. I was able to toggle back & forth between the two editors and consistently reproduce the results. What emacs saved worked fine. What code saved did not.

I've attached the two partials. I'm guessing it's a unicode/text format issue. None of my diff tools showed any difference, but CLEARLY dust.js is treating one differently from the other.

menuItem.toggle.dust.zip

FWIW, here is the template in those attached files:

{@eq key=widget value="true"}
{:else}
<div class="text"><span>{text}</span></div>
<div class="toggleBox">
    <div class="toggleRight"> 
        <div class="text"><span>{true.text}</span></div>
        <img class="toggle" src="../../images/menu/toggle_right.png">
    </div>
    <div class="toggleLeft">
        <div class="text"><span>{false.text}</span></div>
        <img class="toggle" src="../../images/menu/toggle_left.png">
    </div>
</div>
{/eq}

Metadata

Metadata

Assignees

Labels

*duplicateIssue identified as a duplicate of another issue(s)file-ioFile I/OnodejsNodeJS support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions