[FEATURE][BUGFIX] Add error handling, batch resilience demo, and fix batch resolver error propagation#24
Merged
Merged
Conversation
- Add .catch() to batch resolver promise chain to reject all caller promises when the batch resolver fails - Re-throw original error instead of wrapping with Error() - Fix PromiseLock.reject callback type from generic O to any Signed-off-by: JaysonGCS <goh.chung.sern@gmail.com>
…hers - Add test for batch resolver rejection propagating to all callers - Add test for mismatched result count propagating to all callers - Replace deprecated toBeCalledTimes/toBeCalledWith with toHaveBeenCalledTimes/toHaveBeenCalledWith throughout Signed-off-by: JaysonGCS <goh.chung.sern@gmail.com>
- Replace Recoil-based demo with React context + TailwindCSS playground - Add configurable error simulation modes: all reject, result mismatch, and random batch reject (~50% failure per batch) - Use Promise.allSettled to capture partial results from independent batches, showcasing MicroBatcher batch isolation resilience - Add SecurityResult discriminated union for per-cusip success/error state - Render mixed success (indigo) and error (red) security cards - Add event log with color-coded entries including error type - Update project infra: pnpm workspace, lockfiles, husky pre-commit Signed-off-by: JaysonGCS <goh.chung.sern@gmail.com>
…ndling - Replace Recoil-specific webapp description with general playground description - Replace Recoil selectorFamily example with drop-in replacement snippet - Mention error handling scenarios and batch resilience demonstrations Signed-off-by: JaysonGCS <goh.chung.sern@gmail.com>
Signed-off-by: JaysonGCS <goh.chung.sern@gmail.com>
JaysonGCS
added a commit
that referenced
this pull request
May 15, 2026
Triggers release for changes in #24: - Fix batch resolver error propagation to all callers - Add error simulation playground to demo app - Add batch resilience demonstration with partial failure support Signed-off-by: JaysonGCS <goh.chung.sern@gmail.com>
|
🎉 This PR is included in version 1.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a critical error handling gap in the MicroBatcher library where batch resolver failures would leave caller promises hanging indefinitely, and adds comprehensive error simulation scenarios to the demo app to showcase batch-level fault isolation.
Changes Made
Library Fixes
.catch()to the batch resolver promise chain so that when a batch resolver rejects, all caller promises in that batch are properly rejected instead of hanging foreverthrow Error(e)tothrow eto preserve the original error type and stack tracePromiseLock.rejectcallback parameter type fromOtoanyTest Coverage
toBeCalledTimes/toBeCalledWithwithtoHaveBeenCalledTimes/toHaveBeenCalledWithDemo App Rewrite
Promise.alltoPromise.allSettledto capture partial resultsDocumentation
selectorFamilyexample with drop-in replacement snippetDefinition of Done