Skip to content

core-modular: configChanged() does not propagate events to open modals #5414

Description

@JohannesDoberer

Summary

When Luigi.configChanged() is called while a modal is open, core-modular does not send any lifecycle events to the modal MFE. In Luigi Core, the modal correctly receives events depending on the routing.showModalPathInUrl setting.

Luigi Core behavior (verified locally)

With routing.showModalPathInUrl: true

Calling Luigi.configChanged() with a modal open:

  • Main area MFE → addContextUpdateListener fires ("Luigi Client context updated")
  • Modal MFE → addInitListener fires ("Luigi Client initialized")
    • The modal is closed and re-opened from the URL, creating a new iframe

How it works: configChanged()handleRouteChange(configChangedInitiated=true)handleBookmarkableModalPath(true) → reads modal path from URL → openAsModal(_reuseIframeOpener=true)resetMicrofrontendModalData() + openViewInModal()

With routing.showModalPathInUrl: false

Calling Luigi.configChanged() with a modal open:

  • Main area MFE → addContextUpdateListener fires ("Luigi Client context updated")
  • Modal MFE → addContextUpdateListener fires ("Luigi Client context updated")
    • The modal stays open and receives a context update (same as main area)

Core-modular behavior (current)

Regardless of showModalPathInUrl setting:

  • Main area MFE → addContextUpdateListener fires ✓
  • Modal MFE → nothing — no events received ✗

The _ui.update() method re-renders navigation and calls updateMainContent for the content area iframe, but does not propagate context updates to modal iframes and does not handle the bookmarkable modal path.

Expected behavior

  1. showModalPathInUrl: true: On configChanged(), close and re-open modal from URL → modal MFE receives addInitListener
  2. showModalPathInUrl: false: On configChanged(), send context update to modal iframe → modal MFE receives addContextUpdateListener

Affected e2e tests

  • test-context-update-listener.cy.js — "Context in modal" test is skipped until this is resolved
  • Original luigirepo test: cypress/e2e/tests/microfrontends.cy.js → "Context Update Listener test" → "Context in modal"

References

  • Core: core/src/App.svelte line 366-372 (configChanged triggers handleRouteChange)
  • Core: core/src/services/routing.js lines 524-537 (handleBookmarkableModalPath)
  • Core: core/src/App.svelte line 1462-1466 (_reuseIframeOpener logic)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions