vuejs/vuefire

[Bug Fix: Vuexfire] Promise resolving prematurely on collections

Closed this issue · 5 comments

Problem: When binding to collections via the Vuexfire plugin the promise is resolving after the first item is written.

Expectation: The promise should only be resolved after the last item in the collection is written to state.

Sample repo This is a Quasar Project: https://github.com/adamkpurdy/vuexfire_bug

After some research, it looks as if the first binding resolver from the currentUser call is triggering the promise resolver of the second getUsers call.

The expectation is that the console statement should output a value of 3 for the length of the user's call from firestore. This not the case when the currentUser is called in the boot file, as the output is 1. If the call to the currentUser is commented out, the output in the console will be 3 as expected.

A Firebase project has been set up for this repo, and initialized.

Any guidance or direction would be appreciated.

Thank you.

posva commented

Could you put this on a boiled down repro please? with only firebase, vue, vuex and vuexfire?

Upon boiling down the repo outside of the Quasar framework, the bug was not reproducible.

I know this issue is closed and it's over a year later but I'm having the exact same problem. What is the solution to this? Not use quasar? I don't know how quasar would be the issue.

@anubhavkamath I believe how I restructured my Quasar application code solved this. Due to the time and looking into the context of this example I can not remember specifics on where this was a problem with old UX. This example was a boiled-down version of a project I was working on. Feel free to reach out to me on Quasar's Discord server(@adam P) if you have specific questions about your UX and integrating Firebase & Quasar.