Fix silent shared-project misses in Supabase queries
Two of three call sites passing user email to Supabase's `.contains("shared_with", ...)` were sending a raw JS array instead of a JSON-encoded string, so the `@>` predicate matched nothing. Users with shared projects saw empty lists.
Supabase's PostgREST .contains() on a jsonb column requires a JSON-encoded value - '["a@b.c"]' - not a JS array. Pass the array directly and PostgREST serializes it into a different shape, and the containment check silently returns zero rows.
CaliLuke extracted a three-line helper in backend/src/lib/sharedWith.ts:
export function sharedWithContains(email: string): string {
return JSON.stringify([email]);
}
Three call sites are updated: backend/src/lib/access.ts:139 in listAccessibleProjectIds, backend/src/routes/projects.ts:41 in the GET /projects shared-projects branch, and backend/src/routes/tabular.ts:108. The tabular.ts site already had JSON.stringify(...) inline; the other two didn't. So this was a live bug, not a hygiene fix.
The same commit also downgrades the sharedError failure path in projects.ts from a 500 response to a console.warn. Own projects continue to return even if the shared-projects subquery fails.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?