react-query-firebase icon indicating copy to clipboard operation
react-query-firebase copied to clipboard

Query with subscribe enabled makes request after signing out

Open filipweilid opened this issue 3 years ago • 8 comments

I have a query that lists all documents in a collection that I subscribe on and if I sign out I keep getting a snapshot listener error because I have a rule that only allows the documents to be accessed if signed in. The component where the query is located gets unmounted properly and doesn't re-render after signing out. I have also tried to remove the query using the query client before signing out but that doesn't seem to remove the snapshot listener but it does stop the realtime changes from working.

filipweilid avatar Aug 06 '22 23:08 filipweilid

hi there, Can you let me know which version of react-query-firebase you are using, so I investigate this?

cabljac avatar Aug 17 '22 14:08 cabljac

I am on 1.0.0-dev.6 for firestore and 1.0.0-dev.1 for auth

filipweilid avatar Aug 17 '22 15:08 filipweilid

can you see if this persists with the latest dev releases? thanks!

"@react-query-firebase/firestore": "1.0.0-dev.7",
"@react-query-firebase/auth": "1.0.0-dev.2"

cabljac avatar Aug 17 '22 15:08 cabljac

Getting the same error with the latest versions

filipweilid avatar Aug 17 '22 20:08 filipweilid

and react-query 3.x ?

cabljac avatar Aug 18 '22 16:08 cabljac

yeah react-query 3.39.2

filipweilid avatar Aug 18 '22 18:08 filipweilid

I appear to be having this issue as well. I've tried using versions 1.0.0-dev.7 to 1.0.0-dev.0 and it still persisted.

TazBruce avatar Sep 03 '22 03:09 TazBruce

I confirm this issue too, my version is 1.0.0-dev.7. Seems like this is a problem with removing the onSnapshot listener from firstore.

jimmy-chiang avatar Nov 03 '22 08:11 jimmy-chiang