Describe the bug
get Missing or insufficient permissions errors after logout when on dashboard since listeners doesn't properly die
To Reproduce
Steps to reproduce the behavior:
Logout from dashboard.
Expected behavior
Screenshots
Additional context
Since the error message mentions onSnapshot I assume you're accessing the Firebase Database or Cloud Firestore somewhere in your code.
The data that you're reading from the database has security rules configured that require that the user is authenticated. So when you log the user out, that requirement is no longer met, the app loses access to that data, and the observer is canceled.
To prevent this error from appearing, remove the observer before logging the user out.