feat: add group existence validation for all mutations#10
Merged
takaokouji merged 2 commits intomainfrom Dec 22, 2025
Merged
Conversation
Implemented Option C (full protection) for group existence validation: - joinGroup: Added ConditionCheck in TransactWriteItems - reportDataByNode: Converted to Pipeline Resolver with checkGroupExists - fireEventByNode: Converted to Pipeline Resolver with checkGroupExists This ensures that when a group is dissolved, all subsequent operations on that group will fail with appropriate error messages, preventing orphaned data and improving data consistency. Implementation Details: - Created checkGroupExists.js Pipeline Function for reusable validation - Uses DynamoDB GetItem to verify group existence before operations - Returns custom "GroupNotFound" error when group doesn't exist - joinGroup uses ConditionCheck for atomic validation in transactions - reportDataByNode and fireEventByNode use Pipeline Resolvers Cost Optimization: - GetItem requests prevent wasteful PutItem operations to deleted groups - Write operations ($1.25/M) are 5x more expensive than reads ($0.25/M) - Overall cost reduction expected due to eliminated orphaned writes Test Coverage: - Added comprehensive integration tests (7 test cases) - Tests verify all mutations properly reject dissolved groups - E2E test validates complete workflow Resolves #8 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added real-time group dissolution detection to the JavaScript client prototype. When a host node dissolves a group, all member nodes now automatically detect the dissolution via WebSocket subscription and are cleanly disconnected. Implementation details: - Added handleGroupDissolved callback function in app.js (lines 706-735) - Callback unsubscribes from all active subscriptions (data, events, dissolve) - Clears group state and updates UI to show disconnected status - Displays error notification with dissolution message - Called from handleJoinGroup when joining a group (line 384-388) Documentation updates: - Updated README.md to reflect WebSocket subscriptions are now implemented - Added group dissolution detection to features section - Updated test scenarios with dissolution detection test case - Removed outdated "placeholder" language from subscriptions section - Updated implementation status section to show all features as implemented This completes Phase 2-4 dissolve group detection for the JavaScript client. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
Author
JavaScript Client Implementation CompleteAdded real-time group dissolution detection to the JavaScript client prototype ( ChangesImplementation (
Documentation (
TestingTo test with 2 browser windows:
Implementation Status✅ Backend: Group existence validation (Phase 2-1, 2-2, 2-4) This completes the full end-to-end implementation of group dissolution detection. 🤖 Generated with Claude Code |
takaokouji
added a commit
that referenced
this pull request
Jan 10, 2026
- Use L2 construct (GraphqlApi.domainName property) instead of L1 - Use environment variables APPSYNC_CUSTOM_DOMAIN and ROUTE53_PARENT_ZONE_NAME - Update domain naming to match Issue #10 requirements - Make custom domain configuration optional - Use Route53 Alias record with AppSyncTarget - Update .env.example with new variables
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.
Summary
Implements comprehensive group existence validation for all group-related mutations to ensure that operations on dissolved groups fail gracefully with appropriate error messages.
Resolves #8
Implementation Details
Approach: Option C (Full Protection)
Implemented group existence validation for all three critical mutations:
joinGroup: Uses
ConditionCheckinTransactWriteItemsConditionalCheckFailedreportDataByNode: Converted to Pipeline Resolver
checkGroupExists(GetItem)GroupNotFoundwith message "does not exist"fireEventByNode: Converted to Pipeline Resolver
checkGroupExists(GetItem)GroupNotFoundwith message "does not exist"New Components
Pipeline Function:
js/functions/checkGroupExists.jsGROUP#METADATAGroupNotFounderror on failurereportDataByNodeandfireEventByNodeCDK Stack Updates:
lib/mesh-v2-stack.tsCheckGroupExistsFunction(AppSync Function)ReportDataByNodeFunction(AppSync Function)FireEventByNodeFunction(AppSync Function)Resolver Updates:
js/resolvers/Mutation.joinGroup.jsCost Optimization
Why this approach is cost-effective:
Cost Savings:
Example Calculation:
Test Coverage
New Integration Tests:
spec/requests/group_existence_validation_spec.rb7 comprehensive test cases covering:
Test Results:
Error Messages
joinGroup (ConditionCheck):
reportDataByNode & fireEventByNode (Pipeline Resolver):
Breaking Changes
None. This is backward compatible - only adds validation, doesn't change existing successful operations.
Deployment
Staging Deployment:
MeshV2Stack-stghttps://mpe3yhgk6zdxfhjbay2vqcq5qe.appsync-api.ap-northeast-1.amazonaws.com/graphqlFiles Changed
js/functions/checkGroupExists.js(new) - Reusable validation functionjs/resolvers/Mutation.joinGroup.js(modified) - Added ConditionChecklib/mesh-v2-stack.ts(modified) - Pipeline Resolver configurationspec/requests/group_existence_validation_spec.rb(new) - Integration tests🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com