Skip to content

Conversation

@takaokouji
Copy link
Contributor

Summary

Adds the ability for peers to explicitly leave a group, ensuring their membership and temporary status data are cleaned up from the system.

Implementation Details

Backend

  • Added LeaveGroupUseCase for business logic orchestration.
  • Implemented remove_node_from_group (atomic using transact_write_items) and delete_peer_data in DynamoDBRepository.
  • Updated AppSync Lambda handler to route the leaveGroup mutation.

Infrastructure

  • Added leaveGroup mutation and LeaveGroupPayload to GraphQL schema.
  • Configured LeaveGroupResolver in CDK stack linked to the Lambda data source.

Prototype Client

  • Added leaveGroup method to MeshClient library.
  • Updated UI with "Leave Group" button and state management.
  • Improved disconnect logic to automatically trigger leaveGroup for members.

Test Coverage

Unit Tests

  • Added unit tests for LeaveGroupUseCase in spec/unit/use_cases/leave_group_spec.rb.
  • Verified all 5 examples pass.

Integration Tests

  • Added E2E integration tests in spec/requests/leave_group_spec.rb.
  • Verified the complete flow: create group -> join group -> report data -> leave group -> verify data cleanup.
  • All integration tests (45 examples) passed on staging environment.

🤖 Generated with Gemini Code

Co-Authored-By: Gemini noreply@google.com

takaokouji and others added 2 commits December 23, 2025 12:25
Adds the ability for peers to explicitly leave a group, ensuring their membership and temporary status data are cleaned up from the system.

Backend:
- Added LeaveGroupUseCase for business logic orchestration
- Implemented remove_node_from_group (atomic) and delete_peer_data in DynamoDBRepository
- Updated AppSync Lambda handler to route the leaveGroup mutation

Infrastructure:
- Added leaveGroup mutation and LeaveGroupPayload to GraphQL schema
- Configured LeaveGroupResolver in CDK stack linked to the Lambda data source

Prototype Client:
- Added leaveGroup method to MeshClient library
- Updated UI with "Leave Group" button and state management
- Improved disconnect logic to automatically trigger leaveGroup for members

Testing:
- Added unit tests for LeaveGroupUseCase
- Added E2E integration tests in spec/requests/leave_group_spec.rb
- Added mutation fixture for leaveGroup

🤖 Generated with [Gemini Code](https://gemini.google.com/code)

Co-Authored-By: Gemini <noreply@google.com>
@takaokouji takaokouji merged commit 9cd8178 into main Dec 23, 2025
3 checks passed
@takaokouji takaokouji deleted the feat/implement-leave-group branch December 23, 2025 03:31
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.

2 participants