Skip to content

Commit 4c5cf3b

Browse files
authored
Merge branch 'add-comments' into copilot/sub-pr-128
2 parents 3482dd0 + 38194da commit 4c5cf3b

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

backend/api/internal/database/user_queries.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func DeleteUser(username string) error {
228228
return nil
229229
}
230230

231-
// SearchUsers retrieves users whose username starts with the given prefix (case-insensitive), limited to 10 results.
231+
// SearchUsers retrieves users whose username starts with the given prefix (case-insensitive), limited to the specified limit.
232232
func SearchUsers(prefix string, limit int) ([]*ApiUser, error) {
233233
query := `
234234
SELECT id, username, picture, bio, links, settings, creation_date
@@ -267,6 +267,9 @@ func SearchUsers(prefix string, limit int) ([]*ApiUser, error) {
267267
users = append(users, user)
268268
}
269269

270+
if err := rows.Err(); err != nil {
271+
return nil, fmt.Errorf("failed to iterate over user search results: %w", err)
272+
}
270273
return users, nil
271274
}
272275

frontend/app/conversation/[username].tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,11 @@ export default function ConversationScreen() {
8787
let reconnectAttempts = 0;
8888
let reconnectTimeoutId: ReturnType<typeof setTimeout> | null = null;
8989
let isActive = true;
90-
9190
// Connect to WebSocket using API_BASE_URL
9291
const wsBase = getWebSocketBaseUrl(API_BASE_URL);
9392
const wsUrl = `${wsBase}/messages/${encodeURIComponent(
9493
user.username
9594
)}/stream?token=${encodeURIComponent(token)}`;
96-
9795
const connect = () => {
9896
if (!isActive) {
9997
return;

frontend/components/MessageThreadItem.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ export function MessageThreadItem({
3939
}, [username]);
4040

4141
const handlePress = () => {
42-
router.push(`/conversation/${username}`);
42+
router.push({
43+
pathname: "/conversation/[username]",
44+
params: { username },
45+
});
4346
};
4447

4548
return (

0 commit comments

Comments
 (0)