fix(api): use notInArray + inArray in unread-count subqueries
the sql.join() form of NOT IN crashed the route handler before it could respond — vercel surfaced the crash as a plaintext 404 instead of going through hono's exception handler. switching to drizzle's notInArray() / inArray() emits stable parameter bindings and resolves both /v1/me/topics (fresh endpoint) and /v1/topics (older endpoint with the same ANY() pattern bug). also cleans up debug instrumentation that was added while chasing the 404. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -41,8 +41,9 @@ export async function request<T = unknown>(opts: RequestOpts): Promise<T> {
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
let body: unknown;
|
||||
try { body = await res.json(); } catch { body = await res.text(); }
|
||||
const text = await res.text();
|
||||
let body: unknown = text;
|
||||
try { body = JSON.parse(text); } catch { /* leave as text */ }
|
||||
throw new ApiError(res.status, res.statusText, body);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user