Problem/Motivation

Child of #3624396: Plan: Harden InstanceInterface, IslandInterface and DisplayBuildableInterface as public API before RC1. An open builder learns about a change made elsewhere through the event stream, which relays what SseState records. Only the builder's API controllers record a change, after the events that need it, and display_builder_ai does it by hand. Any other writer, a drush command, a migration, a module calling InstanceInterface, records nothing, so open builders keep showing the old state.

Proposed resolution

  • Record the change when an instance is saved as a new revision, every edit, undo and redo included. In-place saves are skipped: adding a translation on GET, and the resave after a mutator. Publishing records too, although its save is in place: open builders show the publish state.
  • Keep the session of the request that made it, so the stream still skips the author, who already has the change on screen. A save outside a request records none, and reaches everyone.
  • Drop saveSseData() and the SSE_EVENTS list from the controllers, and the manual record from display_builder_ai.
  • The builder UI events and their island fan-out stay as they are: they build the response of the current request.
  • Kernel tests: an edit through InstanceInterface and a publish are recorded, adding a translation is not.

Remaining tasks

None.

User interface changes

An open builder now shows a change made outside the builder.

API changes

None.

Data model changes

Comments

mogtofu33 created an issue. See original summary.

mogtofu33’s picture