Skip to content

v0.2.1

Choose a tag to compare

@ChristianAlexander ChristianAlexander released this 03 Feb 14:24
· 9 commits to main since this release

Added

  • object_keys option to control how string keys within field values are converted when loading state from JSON
    • :strings (default) - leaves keys as strings
    • :atoms! - converts to existing atoms only (raises on unknown keys)
    • :atoms - creates atoms as needed (use with caution)
    • Configurable per-object in the DSL options block, or globally via config :durable_object, object_keys: :atoms!
    • DSL setting takes precedence over application config
  • DurableObject.Testing module with ergonomic test helpers
    • use DurableObject.Testing, repo: MyApp.Repo sets up Ecto sandbox and imports helpers
    • Unit testing: perform_handler/4 and perform_alarm_handler/3 for testing handler logic in isolation
    • Alarm assertions: assert_alarm_scheduled/4, refute_alarm_scheduled/4, all_scheduled_alarms/3
    • Alarm execution: fire_alarm/4 to bypass scheduler timing, drain_alarms/3 for alarm chains
    • State assertion: assert_persisted/4 for verifying persisted state
    • Async helper: assert_eventually/2 for polling conditions

Fixed

  • mix durable_object.gen.migration now correctly detects version parameters in existing migrations parsed by Sourceror/Igniter