Skip to content

Cut DB round trips in message creation and harden mention emails - #112

Merged
Ali1raz merged 1 commit into
mainfrom
perf/message-create-round-trips
Nov 13, 2026
Merged

Ali1raz merged 1 commit into
mainfrom
perf/message-create-round-trips

Conversation

@Ali1raz

@Ali1raz Ali1raz commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Run conversation lookup, parent-message lookup, and mention validation concurrently in createMessage instead of sequentially.
  • Drop the interactive transaction around the single nested message.create; Prisma already runs the nested mentions.createMany atomically.
  • Give mention-email steps stable per-recipient IDs so a retry only re-sends the failed recipient.
  • Re-check team/organization membership in the worker before sending, and derive organizationId from the message so edit-triggered events build correct links.

Notes

  • Cheap validation (analyzeContent, empty content, Arcjet PII) still runs before any DB I/O.
  • No schema or API contract changes.
    Only the two intended files were committed; your other working-tree changes were left untouched.

@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
team-flow Ready Ready Preview Nov 7, 2026 6:19pm UTC

@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e6c9bcb2-1f06-4d88-b1e2-10bc05ed5323
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@Ali1raz
Ali1raz merged commit 0650c86 into main Nov 13, 2026
3 of 4 checks passed
@Ali1raz
Ali1raz deleted the perf/message-create-round-trips branch November 13, 2026 17:33

This branch was successfully deployed

1 active deployment
Preview — 565f66d9 Deployed Nov 7, 2026 by vercel[bot]
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.

1 participant