Unplanned
Last Updated: 19 Mar 2025 15:28 by ADMIN
Scheduled for 2025 Q2
SturmA
Created on: 19 Mar 2025 13:23
Type: Bug Report
1
The instance UserIdentity.Current may be overwritten unexpectedly when used with asynchronous calls.

The property UserIdentity.Current is decorated with a [ThreadStatic] attribute, that guarantees a new instance will be created per each thread, when used in a synchronous context.

In asynchronous context, e.g. when an await operation is performed, the current thread is released, and another thread from the thread pool may take over. This can lead to the UserIdentity being overridden or conflicting with another request.

0 comments