penpot/frontend
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-06-22 14:35:10 +02:00
2026-05-29 11:24:58 +02:00
2024-12-23 10:03:10 +01:00
2026-04-07 21:35:00 +02:00
2026-07-01 14:45:41 +02:00
2026-06-30 16:15:30 +02:00
2026-06-11 11:06:12 +02:00
2025-11-05 17:15:19 +01:00