Handling Non-Existent Entities in Effect Typescript: Best Practices
Hi all, what's the right pattern for handling entities that "don't exist"? For example, is it appropriate to rehydrate an entity's initial state in its
toLayer effect, and then persist the state in a finalizer? toLayer expects an effect that can't fail, so should the effect die if the entityId is invalid or for some other reason the initial state can't be loaded (e.g. from a database)? Or should it return RPC handlers that fail instead? Or is it the client's responsibility to ensure it's sending a message to an entityId that actually exists? Or should the initial state be stored locally within the Entity inside something like an Either<Ref> so the error will propagate during the RPC handler? Or something else entirely?