Conflict in Memento

If you loaded Pier into a Pharo image after September, 2022, then it would likely bring up the following error when editing the settings:

 Add: Input is conflicting with concurrent modification

Tracing into this error, the cause is found in this Magritte commit, the error is in MACheckedMemento>>reset. Older code had:

self setOriginal: self pullRaw

The newer code has:

self setOriginal: (self pullRawTransforming: [ :e | e copy ])

When you click save, Magritte checks that the original in the memento matches the original model. For the PRPage in the environment field, the style sheet is a PRFile. The check fails since the memento contains a copy, not the original PRFile.

The Pier project is better off if it stays up-to-date with the projects that it depends on like Pillar and Magritte. The solution chosen to resolve this is to redefine the equals method so it is true for structures and their copies. The message #hash is related to equals, and is also redefined.

Posted by John Borden at 24 April 2023, 3:17 am with tags Pier link