Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe changes introduce improved asynchronous handling in the reply tracker enabling flow, refine the logic for extracting email replies from HTML, add a new test for complex draft extraction, and update the reply tracker to skip archived email threads during processing. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI
participant ReplyTracker
participant Router
User->>UI: Enable Reply Tracker
UI->>ReplyTracker: processPreviousSentEmailsAction(emailAccountId)
activate ReplyTracker
ReplyTracker-->>UI: Promise resolves after processing (now awaited)
deactivate ReplyTracker
UI->>Router: router.push (after processing completes)
Possibly related PRs
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
apps/web/app/(app)/[emailAccountId]/reply-zero/EnableReplyTracker.tsxOops! Something went wrong! :( ESLint: 9.24.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by apps/web/utils/parse/extract-reply.client.test.tsOops! Something went wrong! :( ESLint: 9.24.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by apps/web/utils/parse/extract-reply.client.tsOops! Something went wrong! :( ESLint: 9.24.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/web/app/(app)/[emailAccountId]/reply-zero/EnableReplyTracker.tsx(1 hunks)apps/web/utils/parse/extract-reply.client.test.ts(1 hunks)apps/web/utils/parse/extract-reply.client.ts(1 hunks)apps/web/utils/reply-tracker/check-previous-emails.ts(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
apps/web/utils/parse/extract-reply.client.test.ts (1)
apps/web/utils/parse/extract-reply.client.ts (1)
extractEmailReply(1-65)
apps/web/app/(app)/[emailAccountId]/reply-zero/EnableReplyTracker.tsx (1)
apps/web/utils/actions/reply-tracking.ts (1)
processPreviousSentEmailsAction(31-41)
🔇 Additional comments (3)
apps/web/utils/parse/extract-reply.client.ts (1)
33-38: Improved extraction of email reply contentThe change improves the email reply extraction by directly using the DOM API to get the complete
div[dir="ltr"]element instead of using substring operations. This is more reliable for complex HTML structures and should properly handle the full draft content.apps/web/utils/parse/extract-reply.client.test.ts (1)
114-123: Good test coverage for complex email structuresThis new test case validates that the extraction function correctly handles complex email structures with nested divs and line breaks. The test ensures that the full reply HTML is preserved while properly separating it from the quoted content.
apps/web/utils/reply-tracker/check-previous-emails.ts (1)
43-54: Optimization to skip processing archived threadsGood optimization to skip processing archived email threads. This will improve performance by avoiding unnecessary processing of threads that users have already archived, focusing only on active conversations.
| toast.promise( | ||
| async () => { | ||
| processPreviousSentEmailsAction(emailAccountId); | ||
| await processPreviousSentEmailsAction(emailAccountId); |
There was a problem hiding this comment.
Fixed asynchronous operation sequencing
Adding the await keyword ensures that email processing completes before navigation occurs. This fixes a potential race condition where the user might be redirected before the background task finishes, leading to incomplete data on the next page.
Summary by CodeRabbit
Bug Fixes
Tests