-
Notifications
You must be signed in to change notification settings - Fork 93
chore(DATAGO-115145): Session deletion on project unshare #950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
- Fix bug where can_access_resource() returned True instead of False - Community edition has no sharing, so users cannot access resources via sharing - access is determined solely by ownership - Add 7 unit tests verifying stub behavior: - test_share_resource_returns_false - test_unshare_resource_returns_false - test_can_access_resource_returns_false - test_get_shared_resources_returns_empty_list - test_check_user_access_returns_none - test_get_resource_collaborators_returns_empty_list - test_delete_resource_shares_returns_true 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…project retrieval logic in ProjectService
…thods for community edition
…ess level in methods
…tion - Added method to to retrieve users with shared access. - Updated to delete sessions for both project owners and shared users upon project deletion. - Created integration tests to validate session deletion behavior for both owner and shared users. - Added unit test to ensure returns an empty list for community edition.
Signed-off-by: Jamie Karam <[email protected]>
|
rudraneel-chakraborty
approved these changes
Feb 9, 2026
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.




This pull request adds support for cleaning up sessions created by users with shared access to a project when the project is deleted. Previously, only the project owner's sessions were deleted; now, sessions for all shared users are also soft-deleted. The changes include updates to the resource sharing service interface, implementation in the default sharing service, the project deletion logic, and comprehensive tests for these scenarios.
Project deletion logic improvements
soft_delete_projectinproject_service.pyto also delete sessions for users with shared access to the project, not just the owner, by callingget_shared_usersand iterating over each shared user. After all sessions are deleted, share records are also removed.Resource sharing service interface and implementation
get_shared_usersmethod to theResourceSharingServiceinterface, which returns a list of user emails with shared access to a resource.get_shared_usersinDefaultResourceSharingService, returning an empty list for community edition (no sharing).Testing: Integration and unit tests
test_projects_shared_session_deletion.pyto verify that project deletion properly cleans up sessions for both owners and shared users, including edge cases and multiple shared users.get_shared_usersin the default sharing service, confirming it returns an empty list for community edition.Testing: Infrastructure helpers
get_sessions_for_projecttoDatabaseInspectorto fetch sessions by project, supporting checks for deleted and non-deleted sessions.seed_session_for_projecttoGatewayAdapterto help set up test data by creating sessions associated with projects and users.