fix: batch large .in() lookups in documentVersions

↗ view on GitHub · emileriksenkeev · 2026-07-14 · ce3bdad2

attachActiveVersionPaths / attachLatestVersionNumbers passed every id in a
single PostgREST .in() - beyond ~300 ids the GET URL exceeds the server
limit, supabase-js surfaces the failure only in the discarded error field,
and every document silently loses its storage path. Net effect: any project
with enough documents (RX Labs, 525) got an EMPTY doc context - project
chat saw no documents and wiki builds produced nothing. Batch the lookups
100 ids at a time and log per-batch errors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Repository emileriksenkeev/sydOS
Author emileriksenkeev <emil@keev.co>
Authored
Parents dd9cf0e7
Stats 1 file changed , +36 , -12
Part of Agentic chat run reliability and long-run streaming

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-ce3bdad2.md from inside the repo you want the change in.

⬇ Download capture-commit-ce3bdad2.md