Input is Conflicting with Concurrent Modification

After loading Pier for a production site it is a good idea to start Persistency, so it can survive a crash. Unfortunately adding a new component causes an error similar to Conflict in Memento.

Created a test as:

MACheckedMementoTest>>testClassHasModelChangedElsewhere
        self value: self class.
        self memento reset.
        self deny: self memento hasModelChangedElsewhere

Several of the other tests use self write: instead of self value:, however this is what is used with components.

Code that makes the test work is:

MACheckedMemento>>reset
        super reset.
        self setOriginal: (self pullRawTransforming: [ :e | e isBehavior ifTrue: [ e ] ifFalse: [ e copy ] ])

Using isBehavior in a test is not ideal, it is better to have classes not copy themselves. That would have a large impact.

Class>>copy
	^ self

When experimenting with this, several of the browsers started raising errors (there is a giant X).

Posted by John Borden at 2 December 2023, 4:18 pm with tags Pier link