firebase / firebase/firebase-js-sdk
Error thrown: Firestore has already been started and persistence can no longer be enabled
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Description
I see you are throwing an error in certain situations when trying to setup firebase offline persistence:
https://github.com/firebase/firebase-js-sdk/blob/f5426a51275bb611a5d9a6df3200d0fe5095afa2/packages/firestore/src/api/database.ts#L561-L565
This is completely unexpected, not documented and I think it is a bad idea. The documentation says that, in case of error you will get a rejected promise, which is what I am coding for and what I a m guarding against, however, to my surprise a plain sync error is just thrown and therefore I am not notified in any way.
Please, consider fixing this and adding it to the list of possible rejection values in the returned promise
Contributor guide
Assessment
This issue has not been assessed yet.