Skip to content

2.5.0

Latest

Choose a tag to compare

@jvoegele jvoegele released this 25 Aug 11:21
· 4 commits to master since this release

Agent usage rules in the package, a leaner telemetry payload, a Troubleshooting guide, and CI through Elixir 1.20.

Added

  • usage-rules.md, shipped in the package — WaitForIt's guidance condensed for AI coding agents, in the layout usage_rules syncs from. Pull it into your AGENTS.md with mix usage_rules.sync, or read it at deps/wait_for_it/usage-rules.md.

    It leads with the one rule — on timeout each form behaves as its native counterpart would on a final non-matching evaluation — then the traps that are silent when you get them wrong: a catch-all clause in case_wait/cond_wait disables the waiting entirely (measured: it halts after one evaluation in 4 ms), waiting blocks the calling process and must not happen inside a GenServer callback, signals are node-local, and timeout: :infinity removes all timeout behaviour rather than merely extending it.

  • Elixir 1.19 and 1.20 in the CI matrix, which now spans the declared floor (~> 1.15) through the current release. (#23)

  • A Troubleshooting guide, opening with "Why does the compiler say my pattern will never match?" (#24)

Changed

  • Telemetry metadata env is now a trimmed map rather than the caller's whole Macro.Env (#22). It carries exactly :context, :context_modules, :file, :function, :line and :module — the same six fields WaitForIt.TimeoutError has always exposed.

    A full __ENV__ measured 1019 words (~8 KB), most of it the calling module's import table, embedded in the compiled module once per wait and copied again by every handler forwarding metadata off-process. The trim happens at macro expansion, so the fat term is never emitted:

    before after
    env term 1019 words 29 words
    whole event metadata 1039 words 49 words
    caller's compiled beam 12,612 bytes 3,360 bytes

    Upgrading: a handler reading anything outside those six keys needs updating; one reading env.file or env.line does not.

Installation

{:wait_for_it, "~> 2.5"}

Full changelog · Documentation