Skip to content

Conversation

@tomlarkworthy
Copy link

@tomlarkworthy tomlarkworthy commented Jan 2, 2026

This treats an issue raised here observablehq/runtime#376

V6 runtime will wait for prior promises to resolve, in the case of a generator like Generator.input, the initial value will wait for a truthy value, if the cell is invalidated, the initial value will never be resolved and the runtime is stuck.

In this change we reject any pending promises when a Generator is disposed, ensuring nothing gets hung. By rejecting we ensure nothing interprets this as an actual value.

I can confirm this fixes a behaviour I was observing when running Notebook 1.0 on Runtime v6.0

@mbostock
Copy link
Member

mbostock commented Jan 3, 2026

Do we need a similar fix here? Do you mind testing the new standard lib too?

https://github.com/observablehq/notebook-kit/blob/main/src/runtime/stdlib/generators/observe.ts

@tomlarkworthy
Copy link
Author

yes the issues exists in Notebook 2.0 too, bit harder to fix with async generator sugar so I converted out.
observablehq/notebook-kit#115
That PR against notebook-kit is not meant to be merged yet, more of a conversation tool but I can can tidy it up if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants