Skip to content

v0.2.2

Latest

Choose a tag to compare

@thatsme thatsme released this 17 Sep 08:04
· 3 commits to main since this release

Correctness fixes in the projection lifecycle, and a documentation pass that corrected around thirty-five claims against the code.

Fixed

A Pipeline that dies while the projection is :paused or :halted is monitored again. Only :running handled the :DOWN before, so from the other two the Coordinator kept a dead monitor reference that matched no later :DOWN, and went on beside a Pipeline it had stopped watching for good.

A pause now survives a Pipeline restart. A pause lives in the producer, and the replacement producer starts unpaused, so a Pipeline that died while the projection was paused came back emitting while Scriba.info/2 still reported :paused. The Coordinator reapplies the pause before returning to :paused. A halt likewise survives — its cause is a schema or a permission, which a replacement Pipeline meets in the same way. Neither survives a Coordinator restart, which is the process holding the instruction.

Scriba.Position.cache_put/4 no longer moves a stream's cursor backwards. That cache is what dedup reads, so a lower position overwriting a higher one re-applies events that already committed. Scriba.Watermark.put/4 has always guarded this in SQL with GREATEST; the cache now guards it too.

Scriba.Testing no longer silently skips result validation. It asked function_exported?/3 whether the target defined valid_result?/1, which answers false for a module that merely has not been loaded yet — so whether an invalid handler return was reported as :invalid depended on whether something else had happened to load the target first.

Added

mix scriba.gate --published — the after-publishing half of the gate: hex.pm serves this version, the tag exists, and the install snippet rendered on HexDocs matches the current minor.

Documentation

An audit of every shipped document against the code. The corrections a reader would have been hurt by:

  • :start_from was shown in the README as a use Scriba.Projection option. It is not one — copying that line gives a compile error, and it sits in the paragraph aimed at people migrating from commanded_ecto_projections.
  • MIGRATION.md gave the error_kind for a raised exception as "FunctionClauseError". The stored value is "Elixir.FunctionClauseError" and the filter is an exact match, so the documented query returned nothing.
  • The retry default was written as "100ms, 1s, 10s". At the default of three attempts, only the first two sleeps happen.
  • The README and the architecture document both said a structural halt moves no cursor. Work the per-event pass had already committed does stand.
  • The architecture document described pause/resume as restarting the Pipeline (it does not), gave the integrity-wipeout rule without its blast-radius condition, and called the partitioner consistent hashing where it is modular hashing.
  • Scriba.Target's docs said only Scriba.Target.Ecto ships, and described its result vocabulary as six shapes where valid_result?/1 accepts five.

Newly documented: :subscription_name defaults to "scriba" for every projection, so two projections left on the default contend and one stands by indefinitely while reporting :running; a pause grows the producer's pending queue for its duration; and :lag_interval is the knob behind the lag event.

Upgrading

No migration, no API change. {:scriba, "~> 0.2"} already covers it.

Full changelog: https://github.com/thatsme/scriba/blob/v0.2.2/CHANGELOG.md