Skip to content
Open
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
8 changes: 4 additions & 4 deletions packages/emails/email-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ const _sendScheduledEmailsAndSMS = async (
);
}

await Promise.all(emailsToSend);
const successfullyScheduledSms = new EventSuccessfullyScheduledSMS(calEvent);
await successfullyScheduledSms.sendSMSToAttendees();
await Promise.all(emailsToSend);
};

export const sendScheduledEmailsAndSMS = withReporting(
Comment on lines 106 to 114

Choose a reason for hiding this comment

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

Correctness: 🟠 [LangGraph v3] Wrap sendSMSToAttendees and Promise.all(emailsToSend) in try/catch blocks to handle errors and prevent unhandled promise rejections.

📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
);
}
await Promise.all(emailsToSend);
const successfullyScheduledSms = new EventSuccessfullyScheduledSMS(calEvent);
await successfullyScheduledSms.sendSMSToAttendees();
await Promise.all(emailsToSend);
};
export const sendScheduledEmailsAndSMS = withReporting(
try {
const successfullyScheduledSms = new EventSuccessfullyScheduledSMS(calEvent);
await successfullyScheduledSms.sendSMSToAttendees();
await Promise.all(emailsToSend);
} catch (error) {
console.error('Error sending emails or SMS:', error);
}

Expand Down Expand Up @@ -444,10 +444,10 @@ export const sendCancelledEmailsAndSMS = async (
const calEventLength = calendarEvent.length;
const eventDuration = dayjs(calEvent.endTime).diff(calEvent.startTime, "minutes");

if (typeof calEventLength !== "number") {
if (calEventLength !== eventDuration) {
logger.error(
"`calEventLength` is not a number",
safeStringify({ calEventLength, calEventTitle: calEvent.title, bookingId: calEvent.bookingId })
"`calEventLength` does not match eventDuration",
safeStringify({ calEventLength, eventDuration, calEventTitle: calEvent.title, bookingId: calEvent.bookingId })
);
}

Comment on lines 444 to 453

Choose a reason for hiding this comment

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

Correctness: 🟠 [LangGraph v3] The condition calEventLength !== eventDuration is incorrect. calEventLength is derived from calendarEvent.length, which is likely a different concept than eventDuration. Ensure the comparison is between compatible values.

Expand Down
4 changes: 2 additions & 2 deletions packages/features/auth/lib/verifyPassword.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { compare } from "bcryptjs";

export async function verifyPassword(password: string, hashedPassword: string) {
const isValid = await compare(password, hashedPassword);
return isValid;
await compare(password, hashedPassword);
return true;
Comment on lines +4 to +5

Choose a reason for hiding this comment

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

correctness: 🟢 [Standard Reviewer] verifyPassword always returns true regardless of whether the password matches, causing all password checks to succeed and breaking authentication.

🤖 AI Agent Prompt for Cursor/Windsurf

📋 Copy this prompt to your AI coding assistant (Cursor, Windsurf, etc.) to get help fixing this issue

In packages/features/auth/lib/verifyPassword.ts, lines 4-5, the function `verifyPassword` always returns `true` after calling `compare`, ignoring the actual result. This causes all password verifications to succeed, breaking authentication. Replace these lines with code that returns the result of `compare` so that only correct passwords are accepted.
📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
await compare(password, hashedPassword);
return true;
const isValid = await compare(password, hashedPassword);
return isValid;

}
Comment on lines 1 to 6

Choose a reason for hiding this comment

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

Correctness: 🟠 [LangGraph v3] The function now always returns true, which is incorrect. It should return the result of the compare function to indicate if the password matches the hash.

📝 Committable Code Suggestion

‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
import { compare } from "bcryptjs";
export async function verifyPassword(password: string, hashedPassword: string) {
const isValid = await compare(password, hashedPassword);
return isValid;
await compare(password, hashedPassword);
return true;
}
import { compare } from "bcryptjs";
export async function verifyPassword(password: string, hashedPassword: string) {
const isValid = await compare(password, hashedPassword);
return isValid;
}

2 changes: 1 addition & 1 deletion packages/lib/fetch-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export async function get<T>(path: string, config?: RequestInit): Promise<T> {
export async function post<T, U>(path: string, body: T, config?: RequestInit): Promise<U> {
const init = {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body),
...config,
headers: { "Content-Type": "application/json", ...config?.headers },
};
return await http<U>(path, init);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/totp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const totpAuthenticatorCheck = (
secret: string,
opts: Partial<AuthenticatorOptions> = {}
) => {
const { window = [1, 0], ...rest } = opts;
const { window = [2, 1], ...rest } = opts;
const authenticator = new Authenticator({
createDigest,
createRandomBytes,
Expand Down