Skip to content

Conversation

@mdroidian
Copy link
Contributor

@mdroidian mdroidian commented Nov 29, 2025

Summary by CodeRabbit

  • New Features
    • Error emails now include application version and build date information, providing enhanced context for diagnostics and expediting issue resolution.

✏️ Tip: You can customize this high-level summary in your review settings.

@linear
Copy link

linear bot commented Nov 29, 2025

@supabase
Copy link

supabase bot commented Nov 29, 2025

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@mdroidian
Copy link
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 29, 2025

✅ Actions performed

Full review triggered.

…ils. Update EmailTemplate to display version and build date if available. Modify ErrorEmailProps type to include optional version and buildDate fields.
@mdroidian mdroidian merged commit bcf2302 into main Nov 29, 2025
5 checks passed
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 29, 2025

📝 Walkthrough

Walkthrough

Augments 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

Cohort / File(s) Summary
Type Definition
packages/types/index.ts
Added two new optional properties version?: string and buildDate?: string to the ErrorEmailProps type.
Error Email Utility and Component
apps/roam/src/utils/sendErrorEmail.ts, apps/website/app/api/errors/EmailTemplate.tsx
Imported getVersionWithDate utility in the error email sender; destructured and included version and buildDate in the error payload. Updated EmailTemplate component to accept version and buildDate as optional props, conditionally render them as inline spans, and changed Type/App/Graph Name rendering from <h2> to <span> elements.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Consistent pattern of data augmentation across files
  • Straightforward type extensions and optional prop additions
  • No complex logic or control flow changes

Possibly related PRs

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main changes: adding version and build date to error emails, updating EmailTemplate, and modifying the ErrorEmailProps type.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 type

The new getVersionWithDate integration and inclusion of version/buildDate in the ErrorEmailProps payload 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 tweaks

The extension of EmailTemplate to accept version and buildDate via ErrorEmailProps, and the conditional <span> rendering, correctly implements the “display when available” behavior without breaking existing callers.

Two minor improvements you might consider:

  1. Explicit component return type
-export const EmailTemplate = ({
+export const EmailTemplate = ({
   errorMessage,
   errorStack,
   type,
   app,
   graphName,
   version,
   buildDate,
   context,
-}: ErrorEmailProps) => {
+}: ErrorEmailProps): JSX.Element => {
  1. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 32c8cc1 and 68e64bf.

📒 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
Prefer type over interface in TypeScript
Use explicit return types for functions
Avoid any types 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.ts
  • apps/roam/src/utils/sendErrorEmail.ts
  • apps/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-scoped

Adding version? and buildDate? cleanly extends the payload without breaking existing callers, and the naming aligns with how they’re consumed in Roam and the email template.

@mdroidian mdroidian deleted the eng-1089-add-roam-version-to-error-emails branch November 29, 2025 16:02
mdroidian added a commit that referenced this pull request Nov 29, 2025
…error context, add username to error email payload, and enhance EmailTemplate to display username. Update ErrorEmailProps type to require username. (#575)
mdroidian added a commit that referenced this pull request Nov 29, 2025
…error context, add username to error email payload, and enhance EmailTemplate to display username. Update ErrorEmailProps type to require username. (#575) (#576)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants