Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kyri-petrou
Copy link
Contributor

@kyri-petrou kyri-petrou commented Nov 22, 2024

/fixes #9316

In some complex usage patterns such as the one in the linked issue, we cannot simply revert the state of fiber refs within FiberRef#locally (so that we can reuse the same instance of FiberRefs) as we have to maintain the full "history" of changes made to a FiberRef. The fix to the issue is rather simple; we always update the value of the FiberRef within FiberRef#locally when reverting the value.

The annoying part is that this fix "destroys" some of the optimizations that we had in place as it requires a new instance of FiberRefs to be created whenever we revert the state in FiberRef#locally. I will followup with another PR that will refactor the way that we determine whether to apply shortcuts in FiberRefs

@kyri-petrou kyri-petrou changed the title Fix scoped stream propagation Fix Scope propagation in ZStream#runScoped Nov 22, 2024
@jdegoes jdegoes merged commit 63aa2b0 into zio:series/2.x Nov 23, 2024
18 checks passed
@kyri-petrou kyri-petrou deleted the fix-scoped-stream-propagation-2 branch November 24, 2024 02:39
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.

Strange behavior of the stream scope

2 participants