Andrey Antukh bf58ac0b9e 🐛 Eliminate N+1 query storm in unread comment threads
The dashboard's unread-comment-threads flow fired one
get-profiles-for-file-comments RPC call per file-id, producing
20+ concurrent HTTP requests and 20+ SQL queries for users with
unread threads across multiple files.

Widen the existing get-profiles-for-file-comments RPC to accept a
set of file ids (max 100) instead of a single id. The SQL uses
ANY(?::uuid[]) so a 1-element set has the same query plan as the
previous file_id = ?. Update the frontend unread-threads flow to
send a single batch request, and the workspace fetch-profiles
event to wrap the current file id in a 1-element set. The 100 cap
is enforced in both the frontend (with a log/warn on overflow) and
the schema (:max 100).

Fixes #10587

AI-assisted-by: opencode-go/minimax-m3
2026-07-23 10:01:18 +02:00
..
2026-05-29 11:24:58 +02:00
2026-05-29 11:24:58 +02:00
2026-05-29 11:24:58 +02:00
2026-05-29 11:24:58 +02:00
2026-07-09 19:34:15 +02:00