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
- Position-only updates now keep existing fields. If your code relied on a SET clearing fields, set numeric fields to
0to delete them. The TTL is still replaced on every SET, so keep sendingexpire_seconds. - Consumers of
Delgeofence events now also receive them for expired objects. Use thecommandfield to tell deletions and expiries apart from moves. - Handle
404for missing objects and collections, and400for invalid input. The TypeScript SDK raisesNotFoundErrorandBadRequestError, andget()still resolves tonullfor a missing object. - Check request bodies for misspelt or extra keys: unknown fields are rejected with
400. Thescanand text-search bodies are the options object itself, not{"options": …}. - Send
content-type: application/jsonwith every request body, or the server returns415. - 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.
- Re-create any hook or channel whose area is a
Referencewith an inline GeoJSON, bounds, or circle area. Such definitions are rejected now, and skipped with a warning when an existing AOF is replayed. - Review how you start the server: unknown flags and malformed values now stop it with a non-zero exit.
--helplists every flag, and--flag=valueworks.
Breaking changes
- A SET merges fields instead of replacing them. Fields not in the request are kept. Setting a numeric field to
0deletes it, and a missing field reads as0inwhere,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
400or404instead of500.GETof a missing object returns404instead of200with anullbody. - 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
Referencearea are rejected with400. - The server CLI rejects unknown flags and malformed values.
- Expired objects fire
Delgeofence events.
Added
- Active expiry: a background sweep on the leader deletes expired objects every
expiry_sweep_interval_ms(default100,0disables it). Each expiry is logged, replicated to followers, and firesDelevents. See Persistence. - Metrics
latlng_expired_objects_totalandlatlng_geofence_eval_errors_total. - Machine-readable error codes: a
codefield in WebSocket error frames and anErrorCodein Cap'n Proto responses. See error responses. - TypeScript SDK:
BadRequestErrorandNotFoundError, both subclasses ofHttpError. - Server CLI:
--help,--flag=valuefor every flag, and--listen-addras 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=trueflag 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.