Repository navigation
hidane 0.6.0
hidane 0.6.0 answers like the official emulator in more places, and checks more clients against both emulators. On a database started with --database-edition enterprise, queries and aggregations now follow the enterprise edition's semantics. Requests for project IDs the official emulator refuses are refused, and single project mode warns like the official emulator. Six more batches of differences found by the differential fuzzer are fixed.
Verified against the official Cloud Firestore emulator v1.22.0, as firebase-tools 15.33.0 downloads it. Per-client versions are in docs/sdk-certification.md. The tests replay 26,556 recorded answers of the official emulator, from 57 recordings.
Changes that may affect your tests
These are compatibility fixes (docs/versioning.md): each makes hidane answer as the official emulator does. A test written against hidane's earlier answer can start failing.
-
Project IDs (#335). The official emulator accepts only Cloud project IDs, and so does hidane now:
- lowercase letters, digits and hyphens, not starting with a hyphen, at most 100 characters;
- optionally after a domain and a colon, such as
example.com:my-project.
Any other project ID gets
400Invalid project ID(P) or database ID(D), for example one with uppercase letters (MyProject), an underscore or a leading hyphen. This holds wherever a name appears: in a request's path, in the documents of writes and reads, and in references stored in documents or compared in filters and cursors..and..are refused as project and database IDs. -
Single project mode (#336, #14). firebase-tools starts the emulator with
--project_id <p> --single_project_mode trueunlessemulators.singleProjectModeisfalse. In that mode, a request for another project prints the official warning on standard output, twice:Multiple projectIds are not recommended in single project mode. …. With--single_project_mode_error true, such a request fails withINVALID_ARGUMENTand that message. The project that counts is:- a REST path's;
- for gRPC: the
google-cloud-resource-prefixheader, else thedatabaseofx-goog-request-params, else the name; - a WebChannel URL's
database; - an export's or import's body.
-
Enterprise edition (#338). On the official emulator, a database started with
--database-edition enterpriseruns queries as pipelines. firebase-tools passes that flag forfirestore.edition: "enterprise".- RunQuery (#341). Null equals null and NaN equals NaN.
!=andnot-ininclude documents without the field. The standard edition's restrictions do not apply, such as several negations, twoarray-containsor descending key scans.array-containson a value that is not an array is an error. Array offsets such asa[0]read elements. Results follow the query's own orders only. - RunAggregationQuery (#342). Integers are summed as 64-bit integers, and an overflow is an error. Doubles are summed as decimals, so
0.1 + 0.2is0.3.countcounts every document, andcountwithup_tois an error. - Listeners (#343). They match null and NaN as values.
- Not done yet: a listener on an enterprise database still refuses 34 recorded queries otherwise (D091), and pipelines (
ExecutePipeline) are not implemented (#80).
- RunQuery (#341). Null equals null and NaN equals NaN.
-
Security Rules (#299, #305). A decision stops after 1,000 evaluated expressions, counted as the official emulator counts them, ternary operators included.
-
Differential fuzzing (#262: #280, #303, #306, #311, #312, #323, #326, #327, #330). These batches fix the differences the fuzzer found on several seeds. Among them:
- the order of a query's checks, and how disjunctions and terms are counted;
- a commit's own errors end its transaction;
read_timeprecision and age checks;- Security Rules on lists without a collection ID;
- field order after masked writes;
- doubles printed with Java's tie-break.
-
Listen (#343). A query target of more than one collection now ends the stream, as on the official emulator. hidane answers
INVALID_ARGUMENTwith RunQuery's message where the official emulator answersUNKNOWNwithout one (D006).
New
POST /emulator/v1/projects/{p}[/databases/{d}]:bulkDelete(#337, part of #36). It deletes the documents of every collection with one ofcollection_ids, at any depth, as Datastore's bulk delete does.- Verified clients:
- the iOS SDK (
FirebaseFirestore13.0.1 on macOS, #332) and the Android SDK (firebase-firestore27.0.0 in an Android emulator, #333): documents, queries, aggregations, transactions and listeners, including a listener idle for 95 seconds; - nodejs-firestore's own system tests, over gRPC (#331) and REST (
preferRest, #340): hidane passes all 328 that pass on the official emulator, and@google-cloud/firestorewithpreferRestis now verified; - the requests of googleapis/conformance-tests (#334): all 185 answer as on the official emulator.
- the iOS SDK (
- Benchmark scenarios:
owner_writes, writes with the credential the Admin SDKs send (#290);listen_limit_writes, writes with alimit(50)listener attached (#296). A run that fails is run again once, in a fresh process (#300). A limited query now stops at its documents instead of the end of the collection (#297), which speeds up listeners with a limit. - Parity records: every intentional difference names the tests that pin it (#309), and ADR 0008 describes the recording and replay method (#298).
hidane doctorno longer reports single project mode.
Breaking changes
None to a stable surface. The changes above are compatibility fixes.
Install
curl -fsSL https://hidane.dev/install.sh | sh
brew install hidane-dev/tap/hidane
npm install --save-dev hidane
cargo binstall hidane # or cargo install hidane
dart pub global activate hidane
docker run --rm -p 8080:8080 ghcr.io/hidane-dev/hidane:0.6.0Full changelog: v0.5.1...v0.6.0