raquo / Airstream

State propagation and event streams with mandatory ownership and no glitches
MIT License
247 stars 28 forks source link

FetchStream does not emit events if it's initialized outside of a transaction #106

Closed raquo closed 1 year ago

raquo commented 1 year ago

I'm not yet sure what the exact problem is, or whether it's specific to FetchStream or not.

raquo commented 1 year ago

The problem is specific to FetchStream. As a temporary workaround you can replace FetchStream.get(...) with EventStream.unit().flatMap(_ => FetchStream.get(...)). This initializes FetchStream in a new transaction created by flatMap, avoiding the bug.