freetrade-io / ts-firebase-driver-testing

Swap out Firebase as a driver for in-process testing
MIT License
11 stars 1 forks source link

Simplify Firestore Change Observers #124

Closed rorybainfreetrade closed 2 years ago

rorybainfreetrade commented 2 years ago

Currently we make use the same change observers for both Firestore and RTDB. However, Firestore only supports observing documents, not subpaths within documents. This means we unnecessarily traverse every key within each document written to Firestore, when instead we can just do simple checks like 'did this document exist before'.

This PR adds Firestore specific change observers that do these much simpler checks and should avoid extraneous work traversing each document.

LukeInkster commented 2 years ago

Was the title supposed to say "simplify"?

rorybainfreetrade commented 2 years ago

Was the title supposed to say "simplify"?

Yes, yes it was 🤦