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
4 changes: 2 additions & 2 deletions apps/web/app/api/google/calendar/callback/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type NextRequest, NextResponse } from "next/server";
import { NextResponse } from "next/server";
import { env } from "@/env";
import prisma from "@/utils/prisma";
import { createScopedLogger } from "@/utils/logger";
Expand All @@ -15,7 +15,7 @@ import { prefixPath } from "@/utils/path";

const logger = createScopedLogger("google/calendar/callback");

export const GET = withError(async (request: NextRequest) => {
export const GET = withError(async (request) => {
const searchParams = request.nextUrl.searchParams;
const code = searchParams.get("code");
const receivedState = searchParams.get("state");
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/api/google/linking/callback/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type NextRequest, NextResponse } from "next/server";
import { NextResponse } from "next/server";
import { env } from "@/env";
import prisma from "@/utils/prisma";
import { createScopedLogger } from "@/utils/logger";
Expand All @@ -10,7 +10,7 @@ import { parseOAuthState } from "@/utils/oauth/state";

const logger = createScopedLogger("google/linking/callback");

export const GET = withError(async (request: NextRequest) => {
export const GET = withError(async (request) => {
const searchParams = request.nextUrl.searchParams;
const code = searchParams.get("code");
const receivedState = searchParams.get("state");
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/api/outlook/linking/callback/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type NextRequest, NextResponse } from "next/server";
import { NextResponse } from "next/server";
import { env } from "@/env";
import prisma from "@/utils/prisma";
import { createScopedLogger } from "@/utils/logger";
Expand All @@ -10,7 +10,7 @@ import { parseOAuthState } from "@/utils/oauth/state";

const logger = createScopedLogger("outlook/linking/callback");

export const GET = withError(async (request: NextRequest) => {
export const GET = withError(async (request) => {
if (!env.MICROSOFT_CLIENT_ID || !env.MICROSOFT_CLIENT_SECRET)
throw new SafeError("Microsoft login not enabled");

Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/api/sso/signin/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import { type NextRequest, NextResponse } from "next/server";
import { NextResponse } from "next/server";
import { betterAuthConfig } from "@/utils/auth";
import { SafeError } from "@/utils/error";
import { createScopedLogger } from "@/utils/logger";
Expand All @@ -18,7 +18,7 @@ export type GetSsoSignInResponse = {

const logger = createScopedLogger("api/sso/signin");

export const GET = withError(async (request: NextRequest) => {
export const GET = withError(async (request) => {
const { searchParams } = new URL(request.url);
const { email, organizationSlug } = getSsoSignInSchema.parse({
email: searchParams.get("email"),
Expand Down
17 changes: 14 additions & 3 deletions apps/web/utils/ai/digest/summarize-email-for-digest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,22 @@ I will provide you with:

Guidelines for summarizing the email:
- If the email is spam, promotional, or irrelevant, return "null".
- If the email contains extractable fields such as order details, totals, dates, IDs, payment info, or similar, summarize the content using a list with the format: "Key: Value" separated by newlines.
- Do NOT mention the sender's name or start with phrases like "This is a message from X" or "This email from Y" - the sender information is already displayed separately.
- Jump directly into the content of the email.
- Use bullet points to structure information when there are multiple items or pieces of information.
- For structured data (orders, confirmations, receipts):
• Use bullet points with "Key: Value" format
• Example: "• Order Total: $99.99\\n• Delivery Date: March 15"
- For newsletters and announcements:
• List the key topics or news items as bullet points
• Focus on the actual content, not who sent it
• Example: "• New feature launches next week\\n• 20% discount on all plans\\n• Webinar scheduled for Friday"
Comment on lines +44 to +49
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix escaped newlines in prompt examples.

The examples use \\n (double backslash) which will render as literal \n text in the prompt string, rather than demonstrating actual line breaks. Since this is already within a template string, use \n (single backslash) instead.

Apply this diff:

 - For structured data (orders, confirmations, receipts):
   • Use bullet points with "Key: Value" format
-  • Example: "• Order Total: $99.99\\n• Delivery Date: March 15"
+  • Example: "• Order Total: $99.99\n• Delivery Date: March 15"
 - For newsletters and announcements:
   • List the key topics or news items as bullet points
   • Focus on the actual content, not who sent it
-  • Example: "• New feature launches next week\\n• 20% discount on all plans\\n• Webinar scheduled for Friday"
+  • Example: "• New feature launches next week\n• 20% discount on all plans\n• Webinar scheduled for Friday"
🤖 Prompt for AI Agents
In apps/web/utils/ai/digest/summarize-email-for-digest.ts around lines 44 to 49,
the prompt examples contain escaped newlines written as double backslashes
("\\n") which will render as literal "\n" in the template string; change those
to actual newline escapes ("\n") so the examples produce real line breaks in the
prompt string (update both examples shown to use "\n" instead of "\\n").

- For direct messages:
• Summarize in the second person (as if talking directly to the user)
• Use phrasing like: "You have received…", "You are invited…", "Your request has been…"
• Use bullet points if there are multiple action items or pieces of information
- Only include human-relevant and human-readable information.
- Exclude opaque technical identifiers like account IDs, payment IDs, tracking tokens, or long alphanumeric strings that aren't meaningful to users.
- If the email is a direct message to the user, summarize it in the second person (as if talking directly to the user) using phrasing such as: "You have received…", "X wants you to review…", "You are invited…", etc.
- If second person phrasing is not possible or natural (e.g., for announcements, newsletters, or general updates), summarize in a clear neutral third-person style.
`;

const prompt = `
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.12.2
v2.12.3
Loading