Note that for the main resource, the patches are redundant. We could keep "allPatches" exclusively, but it would make everything a bit more complicated: with a main patch, we don't have to worry about modelUri at all in case of single-resource edition. With multiple-resources, we can rely on allPatches exclusively and ignore the main patch. Keeping both also means we don't break existing clients (and single-resource implementations do not need to change), which is a lot easier.
Change the return value of edit, undo and redo operations, to return one patch per modified resource, in addition to the main-resource patch.
Before:
After:
Note that for the main resource, the patches are redundant. We could keep "allPatches" exclusively, but it would make everything a bit more complicated: with a main patch, we don't have to worry about modelUri at all in case of single-resource edition. With multiple-resources, we can rely on allPatches exclusively and ignore the main patch. Keeping both also means we don't break existing clients (and single-resource implementations do not need to change), which is a lot easier.
Contributed on behalf of STMicroelectronics.