Skip to content

v4.0.0

Compare
Choose a tag to compare
@George-Payne George-Payne released this 02 Sep 10:54
· 84 commits to master since this release

Breaking changes

Add emitEnabled option to createProjection.

Due to a bug on the server, previously, the trackEmittedStreams option was setting emitEnabled, and not trackEmittedStreams. This release adds the emitEnabled option and corrects the behaviour of trackEmittedStreams, with a polyfill for earlier server versions. View

Before:

Setting trackEmittedStreams would enable emitting, but not track streams.

await client.createProjection(PROJECTION_NAME, projectionQuery, {
  trackEmittedStreams: true,
});

After:

Setting emitEnabled works as expected:

await client.createProjection(PROJECTION_NAME, projectionQuery, {
  emitEnabled: true,
});

Setting both emitEnabled and trackEmittedStreams works as expected:

await client.createProjection(PROJECTION_NAME, projectionQuery, {
  emitEnabled: true,
  trackEmittedStreams: true,
});

Setting only trackEmittedStreams will be rejected by the server:

// incorrect
await client.createProjection(PROJECTION_NAME, projectionQuery, {
  trackEmittedStreams: true,
});

Features

Add position to events from stream

When connected to a server that supports it (>22.6), events read from a stream will include their commit and prepare position. View

Bug Fixes

  • Prevent multiple appends within the same event loop creating many batches, and improve backpressure. View
  • Destroy read stream if stream is not found. View
  • Only swallow unimplemented errors when creating server-features. View

Removal of Deprecated Apis

  • Remove deprecated consumer strategy names. View
  • Remove deprecated persistent subscription methods. View
  • Remove deprecated getProjectionStatistics method. View