Problem/Motivation

Configuration Synchronizer uses the config_sync.snapshot_extension_storage service to take a snapshot of extension-provided configuration as last installed. We use this snapshot to determine what updates are available. The snapshot should always reflect the last imported state, whether that is the configuration as originally installed or as updated with Configuration Synchronizer.

Currently we use an all or nothing approach to refresh the snapshot. We import every available update and so refresh all of our snapshots. See ConfigSyncImport::finishBatch().

In #2800321: Allow limiting updates by extension we're trying to enable more nuanced import. Do do so, however, we need to be able to selectively refresh only what is imported.

We need an appropriate event to respond to. We are using ConfigImporter to do our imports. ConfigImporter calls Config::save(), which invokes ConfigEvents::SAVE. However, this event is invoked every time a config item is saved--for example, through the UI, or through core's configuration staging system. We don't want to refresh the snapshot in those instances, because we haven't imported from the extension.

Proposed resolution

We need a way to provide and trigger own event. A possible approach:

With that in place:

  • Register a listener to our custom event.
  • In the listener, delete the specific config item from the config_sync.snapshot_extension_storage storage.

Because ConfigSyncSnapshotter::refreshSnapshot() is a costly operation, we don't want to refresh on each deletion. Instead:

  • Register a listener to ConfigEvents::IMPORT.
  • In the listener, call ConfigSyncSnapshotter::refreshSnapshot().

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#7 config_sync-refresh-2804955-7.patch3.55 KBnedjo

Comments

nedjo created an issue. See original summary.

nedjo’s picture

Issue summary: View changes
nedjo’s picture

Issue summary: View changes
nedjo’s picture

Issue summary: View changes
nedjo’s picture

Issue summary: View changes
nedjo’s picture

Issue summary: View changes
nedjo’s picture

StatusFileSize
new3.55 KB

Roughing in some first steps, untested.

nedjo’s picture

Status: Active » Needs work
nedjo’s picture

Status: Needs work » Closed (won't fix)

After refactoring in 8.x-2.x, this is no longer relevant.