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-07-22 14:18:51 +02:00
2026-06-30 16:15:30 +02:00
2026-06-30 16:15:30 +02:00
2026-01-22 13:55:41 +01:00
2024-05-29 19:05:04 +02:00