[Scene Graph] Entity.SetOrigin API does not work and crashes the server

Summary

When using Entity.SetOrigin(NewOrigin) on a Scene Graph Entity, it freezes the game and after some seconds it crashes the server.

This only happen with that specific function, setting the origin throught other methods works as expected.

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

Try to use the following function on any scene graph entity:
(InEntity:entity).SetOrigin<native><public>(NewOrigin:origin)<transacts>:void

Example:

CustomOrigin := entity_origin {
    Entity := SomeEntity
}

AnotherEntity.SetOrigin(CustomOrigin) # Crash when calling this

Expected Result

Origin is set and does not crashes the server

Observed Result

Server freezes and crashes

Platform(s)

Verse VM

Additional Notes

The comment on the Verse digest says:

# Sets the origin of this entity, in the case the entity does not have a transform_component it will create one and set its origin. This method fails if it recognized dependency recursion.
(InEntity:entity).SetOrigin<native><public>(NewOrigin:origin)<transacts>:void

It says that the function should fail when recognized dependency recursion, but the function is not <decides>. I believe this is an error when generating the digests, and that may be the reason why it is crashing the server when calling it (regardless of recursion actually existing or not).

As I mentioned earlier, setting the origin throught other methods (like directly on transform component) works fine, such as this example:

CustomOrigin := entity_origin {
    Entity := SomeEntity
}

if (TransformComponent := AnotherEntity.GetComponent[transform_component]) {
    set TransformComponent.Origin = option{CustomOrigin} # Works fine
}

I tested other methods (such as Entity.ResetOrigin() and Entity.GetOrigin[]) to check and these works fine. The crash only happens with the Entity.SetOrigin() method.

I noted this issue on v37.00, but after some digging, looks like the <decides> was removed from it in v36.0, so that may be the version that the bug started existing:

- @experimental
# Sets the origin of this entity, in the case the entity does not have a transform_component it will create one and set its origin. This method fails if it recognized dependency recursion.
- (InEntity: entity).SetOrigin<native><public>(NewOrigin: origin)<transacts><decides>: void
+ (InEntity: entity).SetOrigin<native><public>(NewOrigin: origin)<transacts>: void

FORT-955987 has been created and its status is ‘Unconfirmed’. This is now in a queue to be reproduced and confirmed.