fix(app): add friendly not-found handling

This commit is contained in:
Gabriel Brown
2026-07-10 17:24:32 -04:00
parent c4d0f5219a
commit ed21126eea
7 changed files with 203 additions and 5 deletions
+1 -1
View File
@@ -710,7 +710,7 @@ export const get = query({
handler: async (ctx, { jobId }) => {
const ownerId = await getRequiredUserId(ctx);
const job = await ctx.db.get(jobId);
if (job?.ownerId !== ownerId) throw new ConvexError('Agent job not found.');
if (job?.ownerId !== ownerId) return null;
return job;
},
});
+1 -1
View File
@@ -211,7 +211,7 @@ export const get = query({
handler: async (ctx, { threadId }) => {
const ownerId = await getRequiredUserId(ctx);
const thread = await ctx.db.get(threadId);
if (thread?.ownerId !== ownerId) throw new ConvexError('Thread not found.');
if (thread?.ownerId !== ownerId) return null;
const spoon = thread.spoonId ? await ctx.db.get(thread.spoonId) : null;
const job = thread.latestAgentJobId
? await ctx.db.get(thread.latestAgentJobId)