-
Notifications
You must be signed in to change notification settings - Fork 4
ENG-1089 - Enhance error reporting by adding version and build date to error emails. Update EmailTemplate to display version and build date if available. Modify ErrorEmailProps type to include optional version and buildDate fields. #575
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
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
…ils. Update EmailTemplate to display version and build date if available. Modify ErrorEmailProps type to include optional version and buildDate fields.
📝 WalkthroughWalkthroughAugments error email functionality to include version and buildDate metadata. The utility now imports version information, adds it to the error payload, the type definition is extended to support these optional properties, and the email template is updated to conditionally display them. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Pre-merge checks✅ Passed checks (3 passed)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apps/roam/src/utils/sendErrorEmail.ts (1)
3-28: Version/buildDate wiring is correct; consider adding an explicit return typeThe new
getVersionWithDateintegration and inclusion ofversion/buildDatein theErrorEmailPropspayload look correct and keep compatibility with the now-optional props. Roam errors will always carry these fields, while other senders can omit them.As a small TS-style improvement, you could add an explicit return type to
sendErrorEmail:-const sendErrorEmail = async ({ +const sendErrorEmail = async ({ error, type, context, }: { error: Error; type: string; context?: Record<string, unknown>; -}) => { +}): Promise<void> => {This aligns with the guideline to use explicit return types for functions.
apps/website/app/api/errors/EmailTemplate.tsx (1)
5-24: Props extension and conditional rendering look good; consider return type and layout tweaksThe extension of
EmailTemplateto acceptversionandbuildDateviaErrorEmailProps, and the conditional<span>rendering, correctly implements the “display when available” behavior without breaking existing callers.Two minor improvements you might consider:
- Explicit component return type
-export const EmailTemplate = ({ +export const EmailTemplate = ({ errorMessage, errorStack, type, app, graphName, version, buildDate, context, -}: ErrorEmailProps) => { +}: ErrorEmailProps): JSX.Element => {
- Improve readability of the header metadata
Right now, multiple
<span>elements could run together. Wrapping them or adding separators (e.g., put each in its own<div>or add<br />) would make the email content easier to read, especially as more metadata fields are added in the future.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/roam/src/utils/sendErrorEmail.ts(2 hunks)apps/website/app/api/errors/EmailTemplate.tsx(1 hunks)packages/types/index.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/main.mdc)
**/*.{ts,tsx}: Use Tailwind CSS for styling where possible
When refactoring inline styles, use tailwind classes
Prefertypeoverinterfacein TypeScript
Use explicit return types for functions
Avoidanytypes when possible
Prefer arrow functions over regular function declarations
Use named parameters (object destructuring) when a function has more than 2 parameters
Use PascalCase for components and types
Use camelCase for variables and functions
Use UPPERCASE for constants
Function names should describe their purpose clearly
Prefer early returns over nested conditionals for better readability
Files:
packages/types/index.tsapps/roam/src/utils/sendErrorEmail.tsapps/website/app/api/errors/EmailTemplate.tsx
apps/roam/**/*.{js,ts,tsx,jsx,json}
📄 CodeRabbit inference engine (.cursor/rules/roam.mdc)
Prefer existing dependencies from package.json when working on the Roam Research extension
Files:
apps/roam/src/utils/sendErrorEmail.ts
apps/roam/**/*.{ts,tsx,jsx,js,css,scss}
📄 CodeRabbit inference engine (.cursor/rules/roam.mdc)
Use BlueprintJS 3 components and Tailwind CSS for platform-native UI in the Roam Research extension
Files:
apps/roam/src/utils/sendErrorEmail.ts
apps/roam/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/roam.mdc)
apps/roam/**/*.{ts,tsx,js,jsx}: Use the roamAlphaApi docs from https://roamresearch.com/#/app/developer-documentation/page/tIaOPdXCj when implementing Roam functionality
Use Roam Depot/Extension API docs from https://roamresearch.com/#/app/developer-documentation/page/y31lhjIqU when implementing extension functionality
Files:
apps/roam/src/utils/sendErrorEmail.ts
apps/roam/**
📄 CodeRabbit inference engine (.cursor/rules/roam.mdc)
Implement the Discourse Graph protocol in the Roam Research extension
Files:
apps/roam/src/utils/sendErrorEmail.ts
apps/website/**
📄 CodeRabbit inference engine (.cursor/rules/website.mdc)
Prefer existing dependencies from apps/website/package.json when adding dependencies to the website application
Files:
apps/website/app/api/errors/EmailTemplate.tsx
🧬 Code graph analysis (1)
apps/roam/src/utils/sendErrorEmail.ts (2)
apps/roam/src/utils/getVersion.ts (1)
getVersionWithDate(9-24)packages/types/index.ts (1)
ErrorEmailProps(1-10)
🔇 Additional comments (1)
packages/types/index.ts (1)
1-10: New optional fields on ErrorEmailProps are well-scopedAdding
version?andbuildDate?cleanly extends the payload without breaking existing callers, and the naming aligns with how they’re consumed in Roam and the email template.
…error context, add username to error email payload, and enhance EmailTemplate to display username. Update ErrorEmailProps type to require username. (#575)
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.