Select to view content in your preferred language

Portal User Information Undefined Sometimes in Developer Edition 1.14

4668
9
09-12-2024 10:46 AM
Labels (1)
JeffreyThompson2
MVP Regular Contributor

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.

  • The OOTB Add Data Widget could not access any information from the Enterprise Portal. It could still access ArcGIS Online.
  • Using code based on this post, I am adding layers as Experience Builder datasources. When not in this error state, this allows me to use the Select Widget and Data Actions. But when this error state occurs, these features are unavailable.

Is this a known bug? Has it been resolved in 1.15? Is there a known fix or work-around?

GIS Developer
City of Arlington, Texas
0 Kudos
9 Replies
Junshan_Liu
Frequent Contributor

The user info is loaded asynchronously, so the prop.user may be null.

0 Kudos
JeffreyThompson2
MVP Regular Contributor

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. 

GIS Developer
City of Arlington, Texas
0 Kudos
JeffreyThompson2
MVP Regular Contributor

Having now seen additional variants of this problem it appears that this is actually two, maybe three, separate issues that usually occur together but can occur independently.

Issue 1: The props.user value is null and the Add Data Widget cannot communicate with the Enterprise Portal.

Issue 2: The Select Widget and/or data functions fail to load.

Issue 3: The Select Widget may stop detecting selectable layers after initially loading correctly. Possibly triggered by locking the computer.

GIS Developer
City of Arlington, Texas
0 Kudos
Junshan_Liu
Frequent Contributor

This may be caused by the token expiring, I think this issue still exists in 1.15. We'll fix it in the next release.

 

The workaround for this issue is put a widget that uses a non-public data source to make sure the app will be signed in

JeffreyThompson2
MVP Regular Contributor

Can you confirm if this issue was fixed in 1.16?

GIS Developer
City of Arlington, Texas
0 Kudos
XiaodongWang
Esri Contributor

Verified on dev 1.16, I cannot reproduce it any more, it should be fixed now.

JeffreyThompson2
MVP Regular Contributor

I am still seeing this issue in 1.16. props.user is reading as null. And the Add Data Widget is not able to get data from the Enterprise Portal.

JeffreyThompson2_0-1736343992743.png

 

GIS Developer
City of Arlington, Texas
0 Kudos
Junshan_Liu
Frequent Contributor

@JeffreyThompson2 After trying some times, we found one case that the "props.user" will be null: Login first , and then close the browser for more than half an hour, and then open the ExB app, then the user may be null. Is this the case you see?

0 Kudos
JeffreyThompson2
MVP Regular Contributor

We are on an SSO environment so it is difficult to say when we are logged in or out. I have many reports from users about this and other similar issues that suggest stale credentials is a factor in how likely these issues will occur.

With that said, I just logged in for the first time today less than 5 minutes ago and I already see the props.user issue.

GIS Developer
City of Arlington, Texas
0 Kudos