Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces mutation scopes, a new feature that allows controlling whether mutations with the same scope execute sequentially or in parallel. Mutations with the same scope ID will execute sequentially (waiting for the previous one to complete), while mutations with different scope IDs run in parallel.
Key changes:
- Added
MutationScopetype with anidfield to identify mutation scopes - Implemented scope-based queuing mechanism in
MstQueryHandlerthat chains promises for sequential execution - Added comprehensive tests demonstrating both sequential (same scope) and parallel (different scopes) execution behavior
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/mst-query/tests/mstQuery.test.tsx | Removed unnecessary parentheses in two test assertions and added two comprehensive tests verifying sequential execution with same scope and parallel execution with different scopes |
| packages/mst-query/tests/models/AddItemMutation.ts | Modified endpoint to accept custom implementations via meta parameter for testing purposes |
| packages/mst-query/src/create.ts | Added MutationScope type definition and scope parameter to mutation options |
| packages/mst-query/src/QueryClient.ts | Added MutationScope type, private mutationScopes map to track active mutations per scope, and getter method |
| packages/mst-query/src/MstQueryHandler.ts | Implemented core scope logic that queues mutations with the same scope ID sequentially while allowing different scopes to run in parallel |
| packages/mst-query/package.json | Bumped version from 4.2.1 to 4.4.0 reflecting new feature addition |
| packages/mst-query/package-lock.json | Updated lockfile to reflect version change |
Files not reviewed (1)
- packages/mst-query/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.