Zero 0.19

Many, many bugfixes and cleanups

Install

npm install @rocicorp/zero@0.19

Upgrading

Features

  • Add a type param to query.run() so it can wait for server results (doc, bug)
  • await z.mutate.foo.bar() is now await z.mutate.foo.bar().client for consistency with .server, old API still works but deprecated (doc)
  • Improve speed of litestream restore by about 7x
  • Increase replication speed when using JSON by about 25%
  • Add options to analyze-query to apply permissions and auth data (doc).
  • Add option to --lazy-startup to zero-cache to delay connecting to upstram until first connection (doc)
  • Add /statz endpoint for getting some health statistics from a running Zero instance (doc)

Fixes

  • Support passing Request to PushProccesor.process() (PR)
  • Fix layering in PushProcessor to better support custom db implementations (thanks Erik Munson!) (PR)
  • Fix socket disconnects in GCP (PR)
  • Quote Postgres enum types to preserve casing (report)
  • z2s: Return undefined for empty result set when using query.one()
  • z2s: Allow accessing tables in non-public schemas
  • z2s: Allow tx.foo.update({bar: undefined}) where bar is optional to match client behavior
  • Fix broken replication when updating a key that is part of a unique (but non-PK) index
  • solid: Rename useQuery to createQuery to fit Solid naming conventions (old name deprecated)
  • Resync when publications are missing (PR)
  • Fix missing NOT LIKE in query.where() (PR)
  • Fix timezone shift when writing to timestamp/timestamptz and server is non-UTC timezone (thanks Tom Jenkinson!) (PR)
  • Bound time spent in incremental updates to 1/2 hydration time
  • Fix ttl being off by 1000 in some cases 😬 (PR)
  • z2s: Relationships nested in a junction relationship were not working correctly (PR)
  • Custom mutators: Due to multitab, client can receive multiple responses for same mutation
  • Fix deadlock that could happen when pushing on a closed websocket (PR)
  • Fix incorrect shutdown under heavy CPU load (thanks Erik Munson!) (PR)
  • Fix case where deletes were getting reverted (thanks for reproduction Marc MacLeod!) (PR)
  • z2s: Incorrect handling of self-join, and not exists
  • not(exists()) is not supported on the client
  • re-auth on 401s returned by push endpoint
  • Added push.queryParams constructor parameter to allow passing query params to the push endpoint (doc)

Breaking Changes

  • The structure of setting up a PushProcesor has changed slightly. See push endpoint setup or upgrade guide.
  • Not technically a breaking change from 0.18, but if you were using 0.19 canaries, the .server property returns error by rejection again (like 0.18 did) (doc).