Problem/Motivation
Parallel issue on Configuration Provider: #2989625: Optionally normalize config on read in provider storage to faciliate comparison.
Configuration Snapshot is used in Configuration Synchronizer to determine available updates based on comparison to a configuration snapshot.
Differences in config key or value ordering can produce what are essentially spurious differences--the config has not changed, but ordering is different. One factor that can produce differences in ordering is the presence of configuration alters through for example Config Actions Provider.
Proposed resolution
There are two points we could normalize at: read or write. Read is preferable, in that we aren't changing the actual data as stored, only as read. However, since it's a common config workflow to read, alter, and then write, read differences would make their way anyway into the data as saved. So normalization should be optional.
There's a relevant method in Configuration Update Manager, \Drupal\config_update\ConfigDiffer\normalizeArray(). We can't use it directly since it's a protected class method.
Comments
Comment #2
nedjoComment #4
nedjo