Urgent.News

What's breaking now, across thousands of outlets.

Tech

Recording what the Firestore emulator sends to Cloud Functions, and replaying it in Rust

hidane is a reimplementation of the Cloud Firestore emulator as a single Rust binary: no JDK, the same gRPC, REST and WebChannel wire protocols, and it runs under firebase-tools with hidane exec -- firebase emulators:start . Its rule is that every claim of compatibility has a test behind it: scripts record how the official emulator answers, and hidane's test suite replays every recording. Until…

The Firestore emulator has been reimplemented as a single Rust binary named hidane, which provides the same gRPC, REST, and WebChannel wire protocols. hidane runs under firebase-tools and records the official emulator's responses, ensuring compatibility tests are met. Before this update, hidane lacked support for Firestore-triggered Cloud Functions. However, in version 0.4.0, hidane now accepts functions emulator trigger registrations, allowing events to reach the functions.

When you start firebase emulators with Firestore and Functions, the Functions emulator registers each Firestore trigger with the Firestore emulator. After a commit, the Firestore emulator sends an event for each changed document to every relevant trigger by sending a POST request to /functions/projects/{p}/triggers/{key}.

hidane treats the official emulator as a black box and observes the wire communication to understand their conversation. It starts the official emulator with various configurations several times, registers triggers as firebase-tools does, and records all requests, answers, and warnings. The event format differs for v1 and v2 triggers, with v1 using compact JSON bodies and v2 using binary-mode CloudEvents.

The order of events is based on a presized hash order of the triggers, and hidane reproduces this order to ensure compatibility.

In case of delivery failures, the official emulator logs a WARNING, and hidane prints the same wording. The replay process in hidane's tests compares the answer status, requests, and warnings of each event between the official emulator and hidane. hidane also fixed an issue where Java prints the smallest double as 4.9E-324, while hidane printed 5.0E-324.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

A Shared Shell Is Not an Environment Record: A Myth-Busting FAQ

A platform reviewer opened a pull request whose description already read like a finished release note for a small path fix.

  • A shared coding server cannot guarantee a stable environment for testing
  • Environment fingerprint must be recorded beside the green test result
  • Comparing environment fingerprints ensures reliable cross-check of results

Node.js SMS OTP Login Polling for Creator Payouts (with 2FA Evidence)

TL;DR: For a marketplace payout challenge, treat SMS as a restricted authentication channel and delivery status as evidence about transport, not proof that the seller received or entered the code.

  • Implement SMS OTP login using Node.js with delivery status as evidence, not proof of code entry.
  • Store keyed digests of OTPs, avoid message bodies in logs and mask phone numbers.

More from Tuesday 13 October →