# Bug OP-11781 - Race condition with outdated OAuth access token 

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-11781

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 12.4.3 |
| Observed in versions | 12.4.0 |
| Sprint | 12.4.3 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 12.4.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

This bug is super hard to reproduce. So it is not likely that QA can check it.

We believe that we observed this bug on the SWP intances of OpenProject and Nextcloud. The OpenProject front-end emits two requests to the backend asynchronously which both do a request to Nextcloud. They fail when the OAuth access token is outdated. Refreshing the token happens in parallel, which at times leads to race conditions. One request refreshes the OAuth token while the other is still trying to do the same with the same, old refresh token and consequently fails.

We need to put the requests of the front-end into a sequential order and not make the execute in parallel.
