mirror of
https://github.com/zoriya/v10.git
synced 2026-08-15 18:34:22 +00:00
Memoize the run-machinery promise itself (`#promise ??= this.#execute()`) rather than reassigning `#promise` to fresh `Promise.resolve(value)` / `Promise.reject(error)` on settle. The reassigned promises were never awaited, so an errored or aborted task that's not re-run (the norm — the RecurringRunner moves on to a clone) left an unhandled rejection. The memoized promise is the one callers await, so it's always handled. Also closes a sync-throw gap: a `#runFn` that throws synchronously is now captured as a rejected memoized promise instead of leaving `#promise` unset (which would re-execute on the next run()). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>