Closed DavidWeiss2 closed 2 months ago
Saw the conflicts, fixing them.
@jasonbosco Conflict resolved
Looks like tests are failing
In https://github.com/typesense/firestore-typesense-search/pull/70/commits/30105bcdb5ddd131fbd71e8f500907f1ba526306 , there was a change introduced on line 53, regarding the currentDocumentsBatch
variable
const currentDocumentsBatch = thisBatch.docs.map((doc) => utils.typesenseDocumentFromSnapshot(doc));
This implementation resulted in currentDocumentsBatch being an array of pending promises, as typesenseDocumentFromSnapshot
is an asynchronous function (Although only because of the dynamic import of flat
).
So, in https://github.com/typesense/firestore-typesense-search/pull/70/commits/b8d920728880ea3b6170c1445464dc2108ed088f, changing this line to
const currentDocumentsBatch = await Promise.all(thisBatch.docs.map(async (doc) => {
return await utils.typesenseDocumentFromSnapshot(doc);
}));
takes care of the issue, resolving to the corresponding document schema that the import
endpoint expects.
Rebased master into the branch, can now target master.
What needed to fix in this PR in order to merge it?
What needed to fix in this PR in order to merge it?
Tests were failing, I've posted a comment above referencing what went wrong (returning a promise instead of unpacking it)
What needed to fix in this PR in order to merge it?
Tests were failing, I've posted a comment above referencing what went wrong (returning a promise instead of unpacking it)
So now this is just waiting for Jason approval?
This is now available in v1.5.0-rc.1.
The installation link for this RC build is in the link above.
Change Summary
The current batch mechanism is failing on Firestore big collections with a function crash. This PR fixing this issue.
Also on this PR - Better comments for failing batch (the current one get trimmed when multiple errors)
but for v18
PR Checklist