CS-469 [BUG] - Inactive users to not be shown as an option when assigning Evidence tasks. All "Inactive" users should be hidden.#3320
Merged
Conversation
Contributor
|
@cubic-dev-ai please review it. |
Contributor
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Confidence score: 3/5
- In
apps/api/src/people/utils/member-queries.ts, the newisActive: truelist filter can diverge fromfindByIdInOrganizationbehavior, so the same member may be hidden in list views but still retrievable by ID, leading to inconsistent API/UI behavior after merge — align the query predicates across list and by-ID paths (or explicitly enforce/validate impossible states) before merging.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/api/src/people/utils/member-queries.ts">
<violation number="1" location="apps/api/src/people/utils/member-queries.ts:69">
P2: Adding `isActive: true` to the list filter creates an inconsistency: members with `isActive: false` but `deactivated: false` (if such a state exists) are excluded from the list but still returned by `findByIdInOrganization`. Either both methods should apply the same filter, or the logic needs a clear invariant enforced elsewhere.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| where: { | ||
| organizationId, | ||
| ...(includeDeactivated ? {} : { deactivated: false }), | ||
| ...(includeDeactivated ? {} : { deactivated: false, isActive: true }), |
Contributor
There was a problem hiding this comment.
P2: Adding isActive: true to the list filter creates an inconsistency: members with isActive: false but deactivated: false (if such a state exists) are excluded from the list but still returned by findByIdInOrganization. Either both methods should apply the same filter, or the logic needs a clear invariant enforced elsewhere.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/api/src/people/utils/member-queries.ts, line 69:
<comment>Adding `isActive: true` to the list filter creates an inconsistency: members with `isActive: false` but `deactivated: false` (if such a state exists) are excluded from the list but still returned by `findByIdInOrganization`. Either both methods should apply the same filter, or the logic needs a clear invariant enforced elsewhere.</comment>
<file context>
@@ -66,7 +66,7 @@ export class MemberQueries {
where: {
organizationId,
- ...(includeDeactivated ? {} : { deactivated: false }),
+ ...(includeDeactivated ? {} : { deactivated: false, isActive: true }),
...(filters?.onboardAfter || filters?.onboardBefore
? {
</file context>
Contributor
@chasprowebdev I have started the AI code review. It will take a few minutes to complete. |
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.
This is an automated pull request to merge chas/task-assignee into dev.
It was created by the [Auto Pull Request] action.
Summary by cubic
Hides inactive and deactivated users from assignee dropdowns and API results when
includeDeactivatedis false, per CS-469. Also sorts visible assignees alphabetically by name (fallback to email) for a cleaner picker.Written for commit 01a86c3. Summary will update on new commits.