writable-dom icon indicating copy to clipboard operation
writable-dom copied to clipboard

fix: append pending inline text only after unblocked

Open 1000hz opened this issue 6 months ago • 1 comments

Description

This PR fixes an issue where an inline host node would remain empty if it was the last node in the tree and a blocking node was encountered.

Motivation and Context

Previously, the final attempt to append inline text would happen immediately once the writable stream is closed. However, there can potentially be more pending inline text added to the buffer if the writer is currently blocked waiting on an external resource. This text will never be written.

Instead, we should defer the final write until after we've become unblocked.

Checklist:

  • [ ] I have updated/added documentation affected by my changes.
  • [ ] I have added tests to cover my changes

The current architecture of the test fixtures makes it difficult to reproduce the existing issue in a test case because the writer is only closed after all fixture steps are executed.

1000hz avatar Aug 21 '24 16:08 1000hz