Closed IjzerenHein closed 6 years ago
Collection.add doesn't check the schema prior to adding a document to Firestore. This can cause invalid documents to be added to the cloud.
Collection.add
add(data: any): Promise<Document> { return new Promise((resolve, reject) => { const ref = this.ref; if (!ref) throw new Error('No valid collection reference'); <<<<< Should validate schema here ref.add(data).then(ref => { ref.get().then(snapshot => { try { const doc = new this._documentClass(snapshot.ref, { snapshot: snapshot }); resolve(doc); } catch (err) { reject(err); } }, reject); }, reject); }); }
Fixed by v0.12.1
Collection.add
doesn't check the schema prior to adding a document to Firestore. This can cause invalid documents to be added to the cloud.