Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useCollection add does not work offline, and does not return doc IDs #56

Open
mattiaseyram opened this issue Oct 25, 2020 · 1 comment

Comments

@mattiaseyram
Copy link

I'm attempting to use swr-firestore instead of any direct firebase library calls and noticed adding multiple documents does not return their new IDs. After looking at the source, also noticed that the useCollection add won't work if the user is in offline mode.

@nandorojo
Copy link
Owner

nandorojo commented Oct 26, 2020

Interesting. I think this makes sense for offline mode. I'd have to think about the API change for the returning the docs, but at first glance I think your PR is consistent with expected behavior.

The one problem is that you don't really know if the batch fails or anything. At which point I'm left wondering if this should be handled by the user or not. I like the idea of magically solving issues, but it does feel a bit like an anti pattern when it comes to catching errors, so I'll think about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants