Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadNamespaces() doesn't keep resolving order when the second request completes before the first one #1785

Closed
yeromen opened this issue Jun 3, 2022 · 5 comments

Comments

@yeromen
Copy link

yeromen commented Jun 3, 2022

🐛 Bug Report

If we make several requests with loadNamespaces() to different namespaces, in case when the second completes faster than the first one, the first promise resolves first when it's not loaded in fact yet. The bug appeared with version 21.8.0 and higher.

Case 1: The first request completes first - everything is OK

Case 1

Case 2: The second request completes first - Bug

Case 2

To Reproduce

Sample: https://codesandbox.io/s/optimistic-tdd-sycrtt?file=/src/app/app.component.ts

Expected behavior

loadNamespaces() resolves when the appropriate namespace loaded, for example as it worked with version 21.7.1

Case 2 (21 7 1)

Your Environment

  • runtime version: Google Chrome Version 101.0.4951.64
  • i18next version: 21.8.7
  • os: Windows
@adrai
Copy link
Member

adrai commented Jun 3, 2022

Can you create a test that reproduces your behaviour like this, please: https://github.com/i18next/i18next/blob/master/test/i18next.backend.concurrentLoad.spec.js

@adrai
Copy link
Member

adrai commented Jun 3, 2022

@huntharo maybe have a look at it? Was introduced probably because of your PR: #1768

adrai added a commit that referenced this issue Jun 3, 2022
@adrai
Copy link
Member

adrai commented Jun 3, 2022

v21.8.8 should fix that

@adrai
Copy link
Member

adrai commented Jun 3, 2022

have you tried v21.8.8 ?

@yeromen
Copy link
Author

yeromen commented Jun 3, 2022

Works as expected with v21.8.8, thank you!

@adrai adrai closed this as completed Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants