Fix bug where domains aren't re-entered when handlers are executed #110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes tidyverse/ellmer#163
Intro to promise domains: https://gist.github.com/jcheng5/b1c87bb416f6153643cd0470ac756231
This example has always worked correctly:
Meaning, inside of a promise fulfilled handler, the promise domain is correctly in place. However, when promise handlers are nested:
then this test would fail. (Side comment: currently these are both failing with the CRAN version and both passing with the PR version, something must be wrong with the way I wrote these examples!?)
Update: Sorry, I see what's wrong with the above tests--it makes sense that they both fail with CRAN. If
dom
was a real domain that had some kind of side effect (like setting an env var), that side effect would be in place for the first example, but the domain wouldn't be installed as the current promise domain--that was the entire point of the issue that this PR fixes. Let me try again: