onflow / fcl-js

FCL (Flow Client Library) - The best tool for building JavaScript (browser & NodeJS) applications on Flow 🌊
https://onflow.org
Apache License 2.0
323 stars 118 forks source link

[BUG] util-actor breaks if multiple versions of the library are installed at the same time #1885

Closed jribbink closed 1 month ago

jribbink commented 1 month ago

Current Behavior

util-actor will not function correctly if multiple versions are installed at the same time (i.e. conflicting dependencies). This is troublesome because util-actor keeps an internal pid counter, but this relates to overlapping global state (e.g. it encounters pid conflicts).

Expected Behavior

This can be mitigated by checking that the pid is up to date before assigning an actor an address. There is one edge case for actors assigned arbitrary addresses (e.g. transaction polling) where they may still overlap. This isn't necessarily an issue, and is technically a feature of the actor utility, but the problem is that if functionality is different between these two versions this could cause issues. We can probably just ignore this case for now and try to keep it in mind before making breaking changes.

Steps To Reproduce

Try polling transactions between two different pinned versions of FCL/util-actor.

Environment

n/a

What are you currently working on that this is blocking?

No response