Starts in:
1 DAY
22 HRS
43 MIN
36 SEC
Starts in:
1 D
22 H
43 M
36 S
Open Closed

Occasionally logging out due to validating access token error #5257


User avatar
0
burkay created
  • ABP Framework version: v7.2.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hello,

Here are the easiest steps to reproduce the issue we are going to report:

  1. Open the demo at https://commercial-demo.abp.io/ and log in.
  2. Open the home page in at least two tabs.
  3. Refresh all the tabs at the same time. Be as fast as you can.
  4. Optionally, open up the developer tools, go to the Network tab and open up console to see the requests and errors.
  5. Wait until a refresh token request kicks in.

At best, user is logged out in all the other tabs but one tab. At worst, a never ending request loop runs with errors in responses in all tabs. We ran into both cases. Below is a screenshot from the worst case, taken after I hit the stop button of the browser.

This is related to OpenIdDict. The same problem is reported some years ago in a comment for a two-major-previous-version of it: https://github.com/openiddict/openiddict-core/issues/783#issuecomment-528824283 . This comment is also related and very informative about the issue https://github.com/manfredsteyer/angular-oauth2-oidc/issues/218#issuecomment-414158965 .

Sometimes we lose unsaved work when working with too many tabs due to this problem. Your demo also has it, so we hope you come up with a solution, a fix or configuration, soon. Maybe catch the exception and retry for a configurable number of times to get over the race condition. Looking forward to your response.


5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I will confirm that. Thanks.

    Your question credit was refunded.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share your logs.txt with me?

    liming.ma@volosoft.com

  • User Avatar
    0
    burkay created

    Hello,

    I updated the ABP CLI to the version 7.2.2 and created a new project with the below commands:

    dotnet tool update -g Volo.Abp.Cli
    abp new Acme.BookStore -u angular -dbms PostgreSQL -csf
    

    Then followed the steps in the original post with only two tabs. Sent the log file to your e-mail. Please note that there are JavaScript errors as well. Screenshots below.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    We introduced IOpenIddictDbConcurrencyExceptionHandler in 7.3.

    You can test it with 7.3 rc1

  • User Avatar
    0
    burkay created

    Awesome, thank you!

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06