Closed jipodine closed 11 months ago
Yup right, I would go for the excludeLocal
parameter solution, i.e. something like:
StateManager::observe(schemaName, callback, { excludeLocal = false } = {});
StateManager::getCollection(schemaName, { excludeLocal = false } = {});
Fixed with d0d255e and d0d255e
The documentation of the
observe
method states:While I understand that their is a use for this, it seems a bit counter-intuitive as the default behaviour. In particular, when moving code from a client (controller, pure observer) to the server (where creation of states may happen), the result changes.
The wide implications of this to the
SharedStateCollection
seem even more bizarre to me. It is not documented, but as most of the methods rely on on underlyingobserve
, no locally created state ever appear in them:find
,forEach
,onAttach
,onUpdate
, etc.I do not know what would be a good solution
excludeLocal
parameter (for both theobserve
and thegetCollection
methods.observeOthers
method (andgetCollectionOfOthers
?)