[realtime database] concurrent queries on the same path don't work
@jhuleatt y travaille déjà.
Depuis le 13/5/2022.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
Whenever I have multiple react components that reference the same path (.e.g /users), the library seems to get the results mixed up. In my project, I had a navbar element that displayed an "Admin" button if the user is an admin, and a table that shows all of the users, with some cursor-based pagination. Between those components, only the last query would yield any results. Switching to the second page and back to the first yields zero results, even though the queries passed in are the same (I verified this in the debugger).
As part of my troubleshooting, I tried using get() directly from firebase/database instead of using reactfire, and I had the same issue. This lead me to believe that the root cause comes from firebase-js-sdk instead of reactfire. I found the following issue logged there, but it's been open since February with no fix yet. https://github.com/firebase/firebase-js-sdk/issues/6038
I'm not sure if this should be logged in this project, but it pretty much means this library is completely broken for any real-life applications when using realtime database.
Version info
React: 17.0.2
Firebase: 9.8.1
ReactFire: 4.2.0
Other (e.g. Node, browser, operating system) (if applicable): Chrome 101.0.4951.54
Test case
https://codesandbox.io/s/reactfire-repro-4p16yo
Steps to reproduce
The test case shows that the three queries do not work at the same time. The last loaded table seems to take precedence. If you comment out any of the tables and reload the page, you should be able to see that each query works independently.
I've also seen an issue where sometimes the data doesn't come back at all, but I don't have a repro for that yet.
Expected behavior
Multiple queries on the same page should be able to produce different outputs
Actual behavior
Multiple queries on the same page all produce the same output, or no output at all.
- Langage dominant
- TypeScript
- Étoiles
- 3.6k
- Forks
- 403
- Merge moyen
- 5 j 1 h
- PR mergées (30 j)
- 10
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de FirebaseExtended/reactfire
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 38/100
FirebaseExtended/reactfire#801 ·
-
v5
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
FirebaseExtended/reactfire#793 ·
-
v5
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
FirebaseExtended/reactfire#790 · 2 commentaires ·
-
v5
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
FirebaseExtended/reactfire#789 ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
FirebaseExtended/reactfire#788 ·
Toutes les issues de FirebaseExtended/reactfire
Issues similaires
-
Add: Digi World (Romania) SDOuvertecheck:passed streams:add
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
Fission-AI/OpenSpec#1986 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
nestjs/docs.nestjs.com#3554 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
publicodes/publicodes#868 ·
-
namespace operations
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100
EclipseFdn/open-vsx.org#13488 ·
Les mainteneurs répondent en général sous 2 jours