latlng
Changelog

What's new in latlng.

Release notes with upgrade guidance. The complete history lives in CHANGELOG.md and on the GitHub releases page.

v0.2.0

Stricter, more predictable APIs and active expiry. Position updates now keep an object's fields, expired objects fire Del geofence events, client errors return proper 4xx codes, and invalid input is rejected instead of silently accepted.

Upgrading from 0.1.x

  1. Position-only updates now keep existing fields. If your code relied on a SET clearing fields, set numeric fields to 0 to delete them. The TTL is still replaced on every SET, so keep sending expire_seconds.
  2. Consumers of Del geofence events now also receive them for expired objects. Use the command field to tell deletions and expiries apart from moves.
  3. Handle 404 for missing objects and collections, and 400 for invalid input. The TypeScript SDK raises NotFoundError and BadRequestError, and get() still resolves to null for a missing object.
  4. Check request bodies for misspelt or extra keys: unknown fields are rejected with 400. The scan and text-search bodies are the options object itself, not {"options": …}.
  5. Send content-type: application/json with every request body, or the server returns 415.
  6. Validate coordinates before writing: latitudes outside [-90, 90], longitudes outside [-180, 180], non-positive radii and inverted bounds are rejected. Boxes crossing the antimeridian are not supported.
  7. Re-create any hook or channel whose area is a Reference with an inline GeoJSON, bounds, or circle area. Such definitions are rejected now, and skipped with a warning when an existing AOF is replayed.
  8. Review how you start the server: unknown flags and malformed values now stop it with a non-zero exit. --help lists every flag, and --flag=value works.

Breaking changes

  • A SET merges fields instead of replacing them. Fields not in the request are kept. Setting a numeric field to 0 deletes it, and a missing field reads as 0 in where, where_in, and expression filters.
  • JSON-path edits (JSET, JDEL) clear the TTL and keep the fields. JGET on a non-GeoJSON object returns 400.
  • Client errors return 400 or 404 instead of 500. GET of a missing object returns 404 instead of 200 with a null body.
  • Request bodies, search options, nearby queries, field entries, and geofence definitions reject unknown fields.
  • All HTTP errors are JSON, including malformed JSON, unknown routes (404), wrong methods (405), and a missing JSON content type (415).
  • Coordinates, radii, bearings, and bounds are validated on writes and queries. Existing AOF data loads unchanged.
  • Hooks and channels with a Reference area are rejected with 400.
  • The server CLI rejects unknown flags and malformed values.
  • Expired objects fire Del geofence events.

Added

  • Active expiry: a background sweep on the leader deletes expired objects every expiry_sweep_interval_ms (default 100, 0 disables it). Each expiry is logged, replicated to followers, and fires Del events. See Persistence.
  • Metrics latlng_expired_objects_total and latlng_geofence_eval_errors_total.
  • Machine-readable error codes: a code field in WebSocket error frames and an ErrorCode in Cap'n Proto responses. See error responses.
  • TypeScript SDK: BadRequestError and NotFoundError, both subclasses of HttpError.
  • Server CLI: --help, --flag=value for every flag, and --listen-addr as an alias of --listen.

Fixed

  • Hooks and channels can no longer block writes. A failing geofence is skipped and counted instead of failing the write.
  • The documented --capnp-enabled=true flag works.
  • The OpenAPI document describes real schemas for areas, objects, fields, geofence definitions, and search options, including the scan and text-search bodies.
  • Memory mode keeps the webhook queue in memory instead of writing to the working directory.
  • JSET and JDEL validate before they are logged, and coordinate edits update the spatial index.
  • Replayed FSET commands update field indexes.