Skip to content

v0.2.0

Latest

Choose a tag to compare

@sevenboxlabs sevenboxlabs released this 03 Nov 05:03

What's new

Durable operations. A call with real effects can now survive a crash between the action and its record. Mark it with durable=True and an identity=, and Sevenbox records the attempt before it acts. If the process dies, running the flow again is refused until session.recover() checks with the target system through a reconciler you register, so the action isn't repeated. We recommend it for any action with financial effects.

  • current_operation_id() returns an id that stays the same across retries and restarts, to send as the target system's idempotency key.
  • @reconciler(...) tells Sevenbox whether an attempted operation happened, with an idempotency_window for keys that expire.
  • session.resolve_operation() records a person's decision when the target system can't say.
  • session.compensate() runs a durable compensating action and discharges the obligation in one step, and is safe to repeat after a crash.
  • A correction to a decision behind an operation whose outcome is still unknown now shows up in session.obligations() instead of being missed.
  • The Operations Center alerts on operations with an unknown outcome and opens the Decision Browser filtered to them.

This release exists because of #8, where a developer pointed out that a crash between a real refund and its record could make the refund happen twice. Both cases from that issue are now regression tests that kill a real process. Thanks for raising it.

Durable calls are opt in, and code that doesn't use durable=True behaves exactly as before. See the README and docs/api-reference.md for every state and what to do in each case.

Known gap. An operation in the conflicting state can't be settled from the SDK yet. It's tracked in #10 for 0.2.1.

Install

See the README for full instructions. Download the wheel matching your platform and Python version below, then run

pip install warrant_core-0.2.0-<your-platform-and-python-tag>.whl
pip install git+https://github.com/sevenboxlabs/sevenbox.git

sevenbox 0.2.0 requires warrant-core>=0.2.0,<0.3, so install this wheel first.

Testing

271 passed, 1 skipped in the public suite (all 14 adapters, against the real installed framework packages), and 462 passed, 1 skipped in the full suite including the engine. The public suite ran against this exact wheel in a clean venv before tagging, and again after publishing, with the wheel downloaded from this release and sevenbox installed from the v0.2.0 tag in a new clean venv.