-
Notifications
You must be signed in to change notification settings - Fork 284
Description
It seems that the Update() workflow is broken when record class are utilized. Likely because of the value-type semantics of records, which mean when a record is changed, the HashCode changes, making any keys in say a dictionary change (In ways they are not supposed to), making the fact un-findable.
Records should be treated as immutable, however, the Update() method doesn't seem to support this as it expects the same object instance to be mutated, not a new object instance returned (ie. with the non-destructive mutation feature)
- If I mutate a record with a different value in an
Update()I receive aFacts for update do not existexception. - If I use
Update()themyRecord with { MyProp = newValue }syntax, I appear to enter an infinite loop of some sort - If I retract the fact, change the fact, and then insert the fact I end u in an infinite retract -> insert -> retract -> insert loop for the rule(s)
It also seems that because of the retraction of the fact in order to update it, it is not possible to make use of the [Repeatability] attribute 🤔
If there is already support for this, how? If not, what sort of outlook does such support have? Is this something I could help implement?