Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing context object for "addInitListener" when running in preloaded view group with UI5 #4100

Open
felix9607 opened this issue Jan 7, 2025 · 0 comments
Assignees
Labels
question Further information is requested

Comments

@felix9607
Copy link

Description

We are running a UI5 application with the UI5 Support Library.
For that application we defined a viewgroup setting for this application to be loaded on startup.
However, in that case, when the application is loaded in the background, the context object of the addInitListener callback is an empty object.
If the application is loaded initially in the foreground, it is working as expected.

Here is some simple example code from the component.js file:

      init: function () {
                // call the base component's init function
                UIComponent.prototype.init.apply(this, arguments);
                // enable routing
                this.getRouter().initialize();

                Ui5SupportLib.connectTo(this);
                this.LuigiClient = Ui5SupportLib.LuigiClient;
                this.LuigiClient.addInitListener((oContext) => {
                    console.log("Luigi Context:",oContext); // oContext === {} if loaded in the background
                });
.
.
.

Expected result

The context to be available with the data, when loaded in the background as well as in foreground

Actual result

When the application is loaded in the background using viewgroup settings, the oContext object === {}

Steps to reproduce

component.js

      init: function () {
                // call the base component's init function
                UIComponent.prototype.init.apply(this, arguments);
                // enable routing
                this.getRouter().initialize();

                Ui5SupportLib.connectTo(this);
                this.LuigiClient = Ui5SupportLib.LuigiClient;
                this.LuigiClient.addInitListener((oContext) => {
                    console.log("Luigi Context:",oContext); // oContext === {} if loaded in the background
                });
.
.
.

Luigi Config

  "viewGroupSettings": {
            "appVG": {
                "preloadUrl": "http://localhost:8080/index.html#",
                "loadOnStartup": true
            }
        },

Load up another microfrontend and make sure, the callback of addInitListener is fired.

@JohannesDoberer JohannesDoberer self-assigned this Jan 17, 2025
@JohannesDoberer JohannesDoberer added the question Further information is requested label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants