You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running into issues trying to use the MSAL SDK with Apple's concurrency model. Please see the attached screenshots and information. Please advise if there is a way to use the acquireTokenSilentWithParameters and acquireTokenWithParameters.
Runtime Warning Displayed
Thread running at User-Initiated quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. Investigate ways to avoid priority inversions.
Troubleshooting
I have tried various fixes, including wrapping the acquireTokenSilent (and Interactive) in DispatchQueue’s, and creating structures for have a “Sendable” for us MSALSilentTokenParameters and MSALInteractiveTokenParameters. Which then creates the warning – “Stored property 'parameters' of 'Sendable'-conforming struct 'SendableMSALSilentTokenParameters' has non-sendable type 'MSALSilentTokenParameters'; this is an error in the Swift 6 language mode”
Thoughts?
The text was updated successfully, but these errors were encountered:
Hi @jukemoon, thanks for reaching out.
Your code seems blocking "quality-of-service" thread (basically thread that is responsible for ui, animation etc) in low level (background) thread (that we use in silent acquire token). Do you mind trying acquireTokenSilent without using async/await.
Hi @jukemoon, thanks for reaching out. Your code seems blocking "quality-of-service" thread (basically thread that is responsible for ui, animation etc) in low level (background) thread (that we use in silent acquire token). Do you mind trying acquireTokenSilent without using async/await.
Hey @antonioalwan, thanks for the information. That is the async-await (Apple’s concurrency model) version of my code. I have seen this in code that uses completion handlers also. Below is an image of the Quality of Service warning when using completion handlers.
I have tried dispatching the call to acquireTokenSilent call to DispatchQueue.global(qos: .userInteractive).async as well.
Hi @jukemoon, it appears you have the same warning where that the quality-of-service thread is waiting for the Qos thread. Please use the pattern provided here when running acquireTokenSilently. You can use dispatchQueue in the completion closure if an interactiveRequired error occurs.
I am running into issues trying to use the MSAL SDK with Apple's concurrency model. Please see the attached screenshots and information. Please advise if there is a way to use the
acquireTokenSilentWithParameters
andacquireTokenWithParameters
.Runtime Warning Displayed
Thread running at User-Initiated quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. Investigate ways to avoid priority inversions.
Troubleshooting
I have tried various fixes, including wrapping the
acquireTokenSilent
(and Interactive) inDispatchQueue
’s, and creating structures for have a “Sendable” for usMSALSilentTokenParameters
andMSALInteractiveTokenParameters
. Which then creates the warning – “Stored property 'parameters' of 'Sendable'-conforming struct 'SendableMSALSilentTokenParameters' has non-sendable type 'MSALSilentTokenParameters'; this is an error in the Swift 6 language mode”Thoughts?
The text was updated successfully, but these errors were encountered: