Skip to content

🐞 fix: Propagate asynchronous logger failures in examples - #6

Draft
Snowflyt wants to merge 1 commit into
mainfrom
fix/readme-logger-rejection
Draft

Snowflyt wants to merge 1 commit into
mainfrom
fix/readme-logger-rejection

Conversation

@Snowflyt

@Snowflyt Snowflyt commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Yield asynchronous logger results through effectify before resuming the logging effect. A rejected logger Promise now rejects runAsync() with the same error.
  • Keep the README's runtime and type-proof examples aligned.
  • Add in-memory regression coverage for synchronous logging, waiting for asynchronous logging, and rejection without an unhandled derived Promise.

Validation

  • Full npm run typecheck, npm run lint, and npm run test-types (37 proofs) pass with the locked toolchain. Prettier passes for all three changed files.
  • The focused logging example passes with the fix. Restoring the previous handler makes the same regression fail after an event-loop turn, with no timeout needed.
  • A separate old/fixed comparison checks all four Promise identities and confirms that only the old discarded derivative emits unhandledRejection.

Existing runtime limitation

When an effectify Promise rejects, runAsync() rejects without re-entering the suspended program's catch or finally. This example fix preserves that existing behavior; generator unwinding needs a separate runtime change.

CI

CI run 39261259204 passed for 94e10aa6a1388dc8ee40366cc638f1c14db3b4a1: lint, typecheck, and type-proof/runtime tests on Node 18, 20, and 22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant