Skip to content

fix: exclude emailAccountId from nested action createMany#2169

Open
gentlemandev wants to merge 1 commit intomainfrom
fix/action-ownership-nested-create
Open

fix: exclude emailAccountId from nested action createMany#2169
gentlemandev wants to merge 1 commit intomainfrom
fix/action-ownership-nested-create

Conversation

@gentlemandev
Copy link
Copy Markdown
Collaborator

Summary

  • Fixes runtime error "Unknown argument emailAccountId" when creating/updating rules via the UI
  • Prisma auto-fills emailAccountId via the compound FK [ruleId, emailAccountId] in nested createMany under Rule, so passing it explicitly is rejected
  • The private addActionOwnershipToInputs (nested createMany) now only adds messagingChannelEmailAccountId; the public addActionOwnershipToInput (standalone action.create) still adds both fields
  • Regression from rules: enforce action channel ownership #2163

Test plan

  • Unit tests pass (38/38)
  • Browser QA: rule create with Archive action succeeds
  • Browser QA: rule update (add Mark Read action) succeeds
  • DB verified: actions have correct emailAccountId and messagingChannelEmailAccountId

🤖 Generated with Claude Code

Prisma auto-fills emailAccountId via the compound FK [ruleId, emailAccountId]
when using nested createMany under Rule. Passing it explicitly causes
"Unknown argument emailAccountId" at runtime, even though unit tests
(which mock Prisma) don't catch it.

The private addActionOwnershipToInputs (nested createMany) now only adds
messagingChannelEmailAccountId. The public addActionOwnershipToInput
(standalone action.create) still adds both fields.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 5, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
inbox-zero Ignored Ignored Apr 5, 2026 1:50am

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

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