Uncaught (in promise) FirebaseError: Function where() called with invalid data. Unsupported field value: undefined
This is because my computed query gets updated when the user.value.uid is reset on logout, triggering the collection query to re-run. The option API documentation talks about $firestoreUnbind but I can't find a way to do this in the composition API.
Since entries.value is not a _RefFireStore instance anymore, the computed should be garbage collected and not trigger a re-run of the query after logout once the user.value.uid is reset.
Reproduction
https://github.com/mrleblanc101/neobigben/tree/feature/firebase
Steps to reproduce the bug
I have a useCollection that has a dynamic where to fetch only the user data like so:
When I logout, I have this specific error:
This is because my computed query gets updated when the
user.value.uid
is reset on logout, triggering the collection query to re-run. The option API documentation talks about $firestoreUnbind but I can't find a way to do this in the composition API.Expected behavior
My best guess has been to overwrite the value of
entries.value
which is a_RefFireStore
type to an empty Array using a$reset
like documented in [Pinia](https://pinia.vuejs.org/core-concepts/state.html#Resetting-the-state:~:text=In%20Setup%20Stores%2C%20you%20need%20to%20create%20your%20own%20%24reset()%20method%3A) by doing so:Since
entries.value
is not a_RefFireStore
instance anymore, the computed should be garbage collected and not trigger a re-run of the query after logout once theuser.value.uid
is reset.Actual behavior
I still get the error.
Additional information
No response