plug-leaking-promise-race

Installation
SKILL.md

plug-leaking-promise-race

Never re-race the same pool of promises across loop iterations. Each call to Promise.race([A, B, …]) attaches fresh .then handlers to every arm. A promise that survives N iterations accumulates N handler sets. See nodejs/node#17469 and @watchable/unpromise.

Patterns

  • Safe — both arms created per call:

    const value = await Promise.race([
      fetchSomething(),
      new Promise((_, r) => setTimeout(() => r(new Error('timeout')), 5000)),
    ])
    
  • Leakypool survives across iterations, accumulating handlers:

Installs
1
GitHub Stars
108
First Seen
May 20, 2026
plug-leaking-promise-race — socketdev/socket-mcp