hukusuke1007 / flamingo

[Flutter Library] Flamingo is a firebase firestore model framework library. 🐤
https://pub.dev/packages/flamingo
MIT License
118 stars 20 forks source link

Document.onCompleted() is called twice when documentAccessor.save() #29

Closed hajimetakase closed 3 years ago

hajimetakase commented 3 years ago

I think Document.onCompleted() is called twice for each documents.

https://github.com/hukusuke1007/flamingo/blob/7437db4dd66157499d65013230032d6cba7f08a6/flamingo/lib/src/batch.dart#L126 https://github.com/hukusuke1007/flamingo/blob/7437db4dd66157499d65013230032d6cba7f08a6/flamingo/lib/src/document_accessor.dart#L37

Perhaps it should be called once for each documents after batch.commit() is completed?

hajimetakase commented 3 years ago

I don't use this function heavily and it could be the specification.

hukusuke1007 commented 3 years ago

Thank you for reporting. This is bug. I will fix it.