Skip to content

Az/invite display user#538

Closed
ethancha0 wants to merge 6 commits into
mainfrom
az/invite-display-user
Closed

Az/invite display user#538
ethancha0 wants to merge 6 commits into
mainfrom
az/invite-display-user

Conversation

@ethancha0
Copy link
Copy Markdown
Collaborator

Description

Recording/Screenshots

Before

After

Test Plan

Issues

  • Closes #

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 4 files

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="src/server/data/user/queries.ts">

<violation number="1" location="src/server/data/user/queries.ts:60">
P2: `searchUsersByDisplayName` duplicates the new `searchUsersByUsername` query logic almost line-for-line. Consider extracting a shared helper that takes the target member column to avoid future drift.</violation>
</file>

<file name="src/components/groups/add-member-dialog.tsx">

<violation number="1" location="src/components/groups/add-member-dialog.tsx:103">
P2: Using `Promise.all` here makes user search fail entirely when any one of the three search calls errors. Handle partial failures so one endpoint outage doesn’t blank all results.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

.limit(limit);
}

export async function searchUsersByDisplayName(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: searchUsersByDisplayName duplicates the new searchUsersByUsername query logic almost line-for-line. Consider extracting a shared helper that takes the target member column to avoid future drift.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/server/data/user/queries.ts, line 60:

<comment>`searchUsersByDisplayName` duplicates the new `searchUsersByUsername` query logic almost line-for-line. Consider extracting a shared helper that takes the target member column to avoid future drift.</comment>

<file context>
@@ -34,6 +34,54 @@ export async function getUserById(id: string) {
+		.limit(limit);
+}
+
+export async function searchUsersByDisplayName(
+	query: string,
+	excludeUserId: string,
</file context>


searchTimeoutRef.current = setTimeout(async () => {
const results = await searchUsers(query);
const [resultsEmail, resultsDisplay, resultsUser] = await Promise.all([
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: Using Promise.all here makes user search fail entirely when any one of the three search calls errors. Handle partial failures so one endpoint outage doesn’t blank all results.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/components/groups/add-member-dialog.tsx, line 103:

<comment>Using `Promise.all` here makes user search fail entirely when any one of the three search calls errors. Handle partial failures so one endpoint outage doesn’t blank all results.</comment>

<file context>
@@ -94,8 +100,23 @@ export function MemberInviteFields({
 
 			searchTimeoutRef.current = setTimeout(async () => {
-				const results = await searchUsers(query);
+				const [resultsEmail, resultsDisplay, resultsUser] = await Promise.all([
+					searchUsersEmail(query),
+					searchUsersDisplay(query),
</file context>

@ethancha0 ethancha0 closed this May 21, 2026
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