Skip to content

[BUG-28] Effects queued during effect execution are silently dropped #39

Description

@shroy

Severity: P2 · Batch: B3 (effect system)

Location

src/core/hookContext.js:147-154

Root cause

forEach doesn't visit items appended mid-iteration and effectQueue.length = 0 then wipes them — a useEffect registered from inside another effect never runs.

Proposed fix

Drain with while (effectQueue.length).

Verification recipe

Spec: hook whose useEffect body registers another useEffect(spy); run in context; assert spy ran. Expected on unmodified code: never runs → confirmed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions