Patch only sortable config

Created on 19 July 2022, over 2 years ago
Updated 2 June 2023, almost 2 years ago

Problem/Motivation

Patching and merging requires that the resulting array can be predictably sorted or the new elements will be at the end of the array.
In the patch merge test we aggressively sort the array to overcome this. But really we should only be patching sortable arrays and if they are not sortable just patch the whole element instead of drilling into it to find a smaller patch.

I thought of this when going over the issues: #2960941: Provide an API for persistent configuration alters, including for extension-provided config and 📌 Expose API to sort arbitrary config arrays Needs work and really without sorting patching will not be stable.

Proposed resolution

Check if the array to patch has a sorting option defined in its schema.

Add sorting info to schema where we know it to be sorted but not declared.
Open core issues to address sorting.

Remaining tasks

implement

User interface changes

none

API changes

none

Data model changes

The patches are going to be much bigger, especially when used with layoutbuilder config and other notoriously unsortable config.

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇨🇭Switzerland bircher 🇨🇿

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024