Skip to content

fix: Update project state logic to correctly handle user roles and de…#5386

Open
hxrshxz wants to merge 2 commits intolitmuschaos:masterfrom
hxrshxz:fix-project-disappear-5106
Open

fix: Update project state logic to correctly handle user roles and de…#5386
hxrshxz wants to merge 2 commits intolitmuschaos:masterfrom
hxrshxz:fix-project-disappear-5106

Conversation

@hxrshxz
Copy link

@hxrshxz hxrshxz commented Jan 8, 2026

Proposed changes

Fixed issue where projects become invisible when a project owner is disabled, even if other active owners exist. Updated the UpdateProjectState method in the repository layer to only mark a project as removed when the disabled user is the only active owner.

Link to issue: #5106

Types of changes

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices applies)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the commit for DCO to be passed.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

Dependency

NA

Copilot AI review requested due to automatic review settings January 8, 2026 22:37
…activation

Signed-off-by: Harsh <harshmastic@gmail.com>
@hxrshxz hxrshxz force-pushed the fix-project-disappear-5106 branch from 3d3746b to af7cdb2 Compare January 8, 2026 22:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where projects become invisible when a project owner is disabled, even if other active owners exist. The fix updates the UpdateProjectState method in the repository layer to add a filter that checks for other active owners before marking a project as removed.

Key Changes:

  • Added a $not + $elemMatch condition to check if there are other active owners besides the user being deactivated
  • Modified the MongoDB filter to only mark projects as removed when the disabled user is the sole owner

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Harsh <harshmastic@gmail.com>
@hxrshxz hxrshxz force-pushed the fix-project-disappear-5106 branch from f3598f1 to 05f9099 Compare January 8, 2026 23:18
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