-
Notifications
You must be signed in to change notification settings - Fork 11.6k
feat: workflow auto translation #27087
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
base: main
Are you sure you want to change the base?
Conversation
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.
2 issues found across 31 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/prisma/migrations/20260121145242_add_workflow_step_translation/migration.sql">
<violation number="1" location="packages/prisma/migrations/20260121145242_add_workflow_step_translation/migration.sql:23">
P2: Redundant index: The `@@index` on `[workflowStepId, field, targetLocale]` duplicates the `@@unique` constraint on the same columns. A unique index already provides efficient lookups, so the separate `@@index` adds storage overhead and write latency without benefit.
Remove the `@@index([workflowStepId, field, targetLocale])` directive from the Prisma schema at `packages/prisma/schema.prisma:2414`.</violation>
</file>
<file name="packages/features/tasker/tasks/translateWorkflowStepData.ts">
<violation number="1" location="packages/features/tasker/tasks/translateWorkflowStepData.ts:57">
P2: The filtered translations array reindexes results, so `targetLocales[index]` can point to the wrong locale whenever a translation is null. This will save translations under incorrect locales. Map with the original index before filtering so the locale stays aligned.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
packages/prisma/migrations/20260121145242_add_workflow_step_translation/migration.sql
Outdated
Show resolved
Hide resolved
| targetLocales.map((targetLocale) => LingoDotDevService.localizeText(text, userLocale, targetLocale)) | ||
| ); | ||
|
|
||
| const validTranslations = translations |
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.
P2: The filtered translations array reindexes results, so targetLocales[index] can point to the wrong locale whenever a translation is null. This will save translations under incorrect locales. Map with the original index before filtering so the locale stays aligned.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/features/tasker/tasks/translateWorkflowStepData.ts, line 57:
<comment>The filtered translations array reindexes results, so `targetLocales[index]` can point to the wrong locale whenever a translation is null. This will save translations under incorrect locales. Map with the original index before filtering so the locale stays aligned.</comment>
<file context>
@@ -0,0 +1,104 @@
+ targetLocales.map((targetLocale) => LingoDotDevService.localizeText(text, userLocale, targetLocale))
+ );
+
+ const validTranslations = translations
+ .filter((trans): trans is string => trans !== null)
+ .map((trans, index) => ({
</file context>
Devin AI is addressing Cubic AI's review feedbackA Devin session has been created to address the issues identified by Cubic AI. |
The @@index on [workflowStepId, field, targetLocale] duplicates the @@unique constraint on the same columns. A unique index already provides efficient lookups, so the separate @@index adds storage overhead and write latency without benefit. Addresses Cubic AI review feedback (confidence 9/10). Co-Authored-By: unknown <>
What does this PR do?
Fixes #20153
Screen.Recording.2026-01-22.at.12.23.10.AM.mov
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Updates since last revision
@@index([workflowStepId, field, targetLocale])from Prisma schema and migration file. The@@uniqueconstraint on the same columns already provides efficient lookups, so the separate index added unnecessary storage overhead and write latency.Human Review Checklist
translateWorkflowStepData.ts(Cubic flagged potential locale misalignment at confidence 7/10 - not addressed per instructions to only fix 9/10+ confidence issues)Summary by cubic
Adds auto-translation for attendee workflow notifications (email and SMS) with pre-generated translations and locale-aware delivery. Organization users can enable this per step; messages are translated via Lingo.dev and applied at send time.
New Features
Migration
Written for commit 8fc5576. Summary will update on new commits.
Link to Devin run: https://app.devin.ai/sessions/5af578f52c7f411da5021f301f032832
Requested by: unknown ()