-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Hello!
I am running the latest version of the central dashboard (from https://github.com/kubeflow/kubeflow/tree/master/components/centraldashboard). I am facing a strange situation where the synchronization of my iframe is not working correctly.
My setup:
I am running the dashboard locally with Docker with an externalLink
pointing to /models
. All the requests with this prefix go though an nginx and will be redirected to a MlFlow instance. This works well.
Next, I am using a custom authentication plugin which will serve an Angular application behind /models/oidc/ui
. As soon as I navigate to pages of the plugin, the synchronization does not work correctly. Sometimes the URL of the dashboard does not reflect the URL of the iframe by either not updating or by changing to a wrong URL which will lead to a 404.
Details
How I understand the synchronization:
Sync from iFrame to parent:
click
andhashchange
eventlistener capture changes in the iframe location- the location is compared with a previous stored location in the
this.page
variable - if the location changed:
- this triggers
_routePageChanged
which will change the window history - which will lead to an updated location in the browser as well and the parent hash
- the hash change then triggers
_routePageChanged
again
- this triggers
- if the location did not change, nothing happens
Sync from parent to iframe:
- everytime the location of the parent frame changes,
_iframePageChanged
is triggered - this will trigger
_srcChanged
to actually change the iframe src
Steps to reproduce
- Run an iFrame with a link to a new page (making a GET request, no client side routing)
- Click the link
Expected Behavior:
The URL of the dashboard should reflect the URL of the iFrame.
Observed Behavior:
The URL of the dashboard does not reflect the URL of the iFrame.
Solution
The problem does not occur when I remove the routeHash
change in _iframePageChanged
. The change of the hash is reflected by the window history replacement anyways, so it seems like it can be removed.
I further had to change the load
event listener of the IframeContainer
to set the current page each time the iframe is loaded.
To me it seems that there might be a timing issue with the click event listener and the page load.