Skip to content

Audit fixes: async semantics, zero-value safety, keyed removal #11

@joshuafuller

Description

@joshuafuller

Summary

This issue tracks a set of correctness and documentation fixes identified during a security/quality audit.

Problems Found

  • Async Emit behavior was effectively blocking and did not consistently respect cancellation timing.
  • Zero-value signals could be unsafe to use without explicit initialization.
  • Keyed listener removal could remove unkeyed listeners.
  • Sync Emit skipped error-returning listeners (TryEmit is the error-propagating path).
  • README performance and behavior claims did not match actual behavior.

Fixes Implemented

  • Async Emit is now fire-and-forget and checks context cancellation before scheduling listeners.
  • Zero-value signals are safe to use.
  • Keyed removal only removes keyed listeners.
  • Sync Emit invokes error listeners (ignores their errors) while TryEmit still stops on error/cancel.
  • README updated to reflect real behavior and benchmark guidance.

Tests

  • go test ./... -count=1

Related

  • PR: from fork joshuafuller:fix/all

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions