Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/mail/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const getServerTrpc = (req: Request) =>
createTRPCClient<AppRouter>({
links: [
httpBatchLink({
maxItems: 1,
maxItems: 8,
url: getUrl(),
transformer: superjson,
headers: req.headers,
Expand Down
2 changes: 1 addition & 1 deletion apps/mail/lib/trpc.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const getServerTrpc = (req: Request) =>
createTRPCClient<AppRouter>({
links: [
httpBatchLink({
maxItems: 1,
maxItems: 8,
url: getUrl(),
transformer: superjson,
headers: req.headers,
Expand Down
8 changes: 4 additions & 4 deletions apps/mail/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"nuqs": "2.4.0",
"partysocket": "^1.1.4",
"pluralize": "^8.0.0",
"posthog-js": "1.236.6",
"posthog-js": "1.256.0",
"prosemirror-model": "1.25.1",
"prosemirror-state": "1.4.3",
"prosemirror-view": "1.39.3",
Expand Down Expand Up @@ -117,6 +117,8 @@
},
"devDependencies": {
"@cloudflare/vite-plugin": "^1.3.1",
"@inlang/cli": "^3.0.0",
"@inlang/paraglide-js": "2.1.0",
"@tailwindcss/typography": "0.5.16",
"@types/accept-language-parser": "^1.5.8",
"@types/canvas-confetti": "1.9.0",
Expand All @@ -137,8 +139,6 @@
"typescript": "catalog:",
"vite": "^6.3.5",
"vite-tsconfig-paths": "^5.1.4",
"wrangler": "catalog:",
"@inlang/paraglide-js": "2.1.0",
"@inlang/cli": "^3.0.0"
"wrangler": "catalog:"
}
}
2 changes: 1 addition & 1 deletion apps/mail/providers/query-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const trpcClient = createTRPCClient<AppRouter>({
transformer: superjson,
url: getUrl(),
methodOverride: 'POST',
maxItems: 1,
maxItems: 8,
fetch: (url, options) =>
fetch(url, { ...options, credentials: 'include' }).then((res) => {
const currentPath = new URL(window.location.href).pathname;
Expand Down
23 changes: 12 additions & 11 deletions apps/server/src/pipelines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class MainWorkflow extends WorkflowEntrypoint<Env, Params> {
const match = subscriptionName.toString().match(regex);
if (!match) {
log('[MAIN_WORKFLOW] Invalid subscription name:', subscriptionName);
throw new Error('Invalid subscription name');
throw new Error(`Invalid subscription name ${subscriptionName}`);
}
const [, connectionId] = match;
log('[MAIN_WORKFLOW] Extracted connectionId:', connectionId);
Expand All @@ -69,11 +69,11 @@ export class MainWorkflow extends WorkflowEntrypoint<Env, Params> {
const status = await env.subscribed_accounts.get(`${connectionId}__${providerId}`);
if (!status || status === 'pending') {
log('[MAIN_WORKFLOW] Connection id is missing or not enabled %s', connectionId);
throw new Error('Connection is not enabled');
return 'Connection is not enabled';
}
if (!isValidUUID(connectionId)) {
log('[MAIN_WORKFLOW] Invalid connection id format:', connectionId);
throw new Error('Invalid connection id');
return 'Invalid connection id';
}
const previousHistoryId = await env.gmail_history_id.get(connectionId);
if (providerId === EProviders.google) {
Expand Down Expand Up @@ -164,9 +164,9 @@ export class ZeroWorkflow extends WorkflowEntrypoint<Env, Params> {
.select()
.from(connection)
.where(eq(connection.id, connectionId.toString()));
if (!foundConnection) throw new Error('Connection not found');
if (!foundConnection) throw new Error(`Connection not found ${connectionId}`);
if (!foundConnection.accessToken || !foundConnection.refreshToken)
throw new Error('Connection is not authorized');
throw new Error(`Connection is not authorized ${connectionId}`);
log('[ZERO_WORKFLOW] Found connection:', foundConnection.id);
return foundConnection;
});
Expand All @@ -182,7 +182,7 @@ export class ZeroWorkflow extends WorkflowEntrypoint<Env, Params> {
const { history } = await driver.listHistory<gmail_v1.Schema$History>(
historyId.toString(),
);
if (!history.length) throw new Error('No history found');
if (!history.length) throw new Error(`No history found ${historyId} ${connectionId}`);
log('[ZERO_WORKFLOW] Found history entries:', history.length);
return history;
} catch (error) {
Expand Down Expand Up @@ -386,9 +386,9 @@ export class ThreadWorkflow extends WorkflowEntrypoint<Env, Params> {
.from(connection)
.where(eq(connection.id, connectionId.toString()));
this.ctx.waitUntil(conn.end());
if (!foundConnection) throw new Error('Connection not found');
if (!foundConnection) throw new Error(`Connection not found ${connectionId}`);
if (!foundConnection.accessToken || !foundConnection.refreshToken)
throw new Error('Connection is not authorized');
throw new Error(`Connection is not authorized ${connectionId}`);
log('[THREAD_WORKFLOW] Found connection:', foundConnection.id);
return foundConnection;
},
Expand Down Expand Up @@ -441,7 +441,7 @@ export class ThreadWorkflow extends WorkflowEntrypoint<Env, Params> {
return step.do(`[ZERO] Vectorize Message ${message.id}`, async () => {
log('[THREAD_WORKFLOW] Converting message to XML:', message.id);
const prompt = await messageToXML(message);
if (!prompt) throw new Error('Message has no prompt');
if (!prompt) throw new Error(`Message has no prompt ${message.id}`);
log('[THREAD_WORKFLOW] Got XML prompt for message:', message.id);
log('[THREAD_WORKFLOW] Message:', message);

Expand Down Expand Up @@ -512,7 +512,8 @@ export class ThreadWorkflow extends WorkflowEntrypoint<Env, Params> {
},
);

if (!embeddingVector) throw new Error('Message Embedding vector is null');
if (!embeddingVector)
throw new Error(`Message Embedding vector is null ${message.id}`);

return {
id: message.id,
Expand Down Expand Up @@ -688,7 +689,7 @@ export class ThreadWorkflow extends WorkflowEntrypoint<Env, Params> {
},
);

if (!embeddingVector) throw new Error('Thread Embedding vector is null');
if (!embeddingVector) return console.error('Thread Embedding vector is null');

try {
log('[THREAD_WORKFLOW] Upserting thread vector');
Expand Down
Loading