Az/invite display user#538
Closed
ethancha0 wants to merge 6 commits into
Closed
Conversation
looks for username and displayname, 2 new routes for database
Contributor
There was a problem hiding this comment.
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( |
Contributor
There was a problem hiding this comment.
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([ |
Contributor
There was a problem hiding this comment.
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>
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.
Description
Recording/Screenshots
Before
After
Test Plan
Issues