-
Notifications
You must be signed in to change notification settings - Fork 1.3k
cold-email: Fix date parsing in Cold Email Blocker test action #1159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ import { createEmailProvider } from "@/utils/email/provider"; | |
| import type { EmailProvider } from "@/utils/email/types"; | ||
| import { getColdEmailRule } from "@/utils/cold-email/cold-email-rule"; | ||
|
Comment on lines
14
to
15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 MEDIUM - JSDoc comment uncertainty contradicts actual schema Category: docs Description: Suggestion: Confidence: 75% |
||
| import { getRuleLabel } from "@/utils/rule/consts"; | ||
| import { internalDateToDate } from "@/utils/date"; | ||
|
|
||
| export const markNotColdEmailAction = actionClient | ||
| .metadata({ name: "markNotColdEmail" }) | ||
|
|
@@ -143,7 +144,7 @@ export const testColdEmailAction = actionClient | |
| to: "", | ||
| subject, | ||
| content, | ||
|
Comment on lines
144
to
146
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 MEDIUM - Using || operator instead of ?? for null values Category: quality Description: Suggestion: Confidence: 70% |
||
| date: date ? new Date(date) : undefined, | ||
| date: date ? internalDateToDate(String(date)) : undefined, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 MEDIUM - Ternary condition treats valid zero as falsy Category: bug Description: Suggestion: Confidence: 65% |
||
| threadId: threadId || undefined, | ||
| id: messageId || "", | ||
| }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 MEDIUM - Inconsistent null coalescing in TestRules.tsx
Agent: typescript
Category: quality
Description:
Lines 172-177 mix || null and || undefined interchangeably when passing parameters. textHtml uses || null but internalDate uses || undefined, creating type inconsistency.
Suggestion:
Standardize on one approach using ?? to preserve falsy values correctly:
textHtml: message.textHtml ?? null,date: message.internalDate ?? undefined,Confidence: 70%
Rule:
ts_strict_null_checksReview ID:
9c67e485-7baa-4aee-8a5d-c988494444edRate it 👍 or 👎 to improve future reviews | Powered by diffray