I am using Developer Edition 1.14 with ArcGIS Enterprise 10.9.1 with SSO authentication. My Experience Builder application will sometimes load in a state where certain features are unavailable. I believe this is caused by an error in how the 10.X version of ArcGIS Enterprise handles SSO authentication because of issues seen in previous versions of Experience Builder and the errors I am dealing with.
This issue was originally discovered in a custom widget that accessed the props.user attribute to apply some user based customization to my application. Sometimes the site would load as expected, other times the props.user attribute would be undefined resulting in the widget crashing. It would often take multiple reloads for the error to clear itself and the site to load correctly. The most reliable way for triggering this error appears to be making some connection to the ArcGIS Enterprise Portal then allowing it to go stale for about an hour and then refreshing the application. The most reliable way for clearing the error is to first visit the Portal homepage and then loading the application. This same code worked reliably in Experience Builder 1.12.
After wrapping the offending code in an if statement, so it would not crash the whole application. I discovered additional issues related to this error.
Is this a known bug? Has it been resolved in 1.15? Is there a known fix or work-around?
The user info is loaded asynchronously, so the prop.user may be null.
I always use an useEffect function to delay my widgets until after the mapView has loaded. From what I have seen, the props.user data either loads faster than the map data or not at all.
I have tried a recursive call to setTimeout to repeatedly check if the props.user data has loaded. When in this error state, the user data will never load and the other effects noted above will not resolve themselves.