Conversation
…th portal (#2857) When inviting a user with both app access (admin) and compliance obligations (employee) with the portal checkbox enabled, send a single app invite email that includes the portal link — instead of only the portal email which lacked the app invitation link. Co-authored-by: Mariano Fuentes <marfuen98@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Root cause: DescriptionEditor stored `draft` and `mode` as independent
state synced to the `value` prop via a chain of 4 useEffects. When
switching from a strategy with content to one without, mode flipped to
'edit' and the resync effect's edit-mode guard blocked reloading the
original plan when switching back.
Rewrote the component to use a single `draft: string | null` state —
null means preview mode (render value directly from props), string
means edit mode. This eliminates the 4 sync effects entirely and makes
the state model trivial: enter edit → copy value into draft, save →
push draft up and clear, cancel → clear.
Strategy changes remount the editor via key={strategy} so internal
state initializes fresh from the new value.
Also hides the "Generate treatment plan" button for non-Mitigate
strategies since regeneration always produces a mitigation plan.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/app/src/components/risks/treatment-plan/DescriptionEditor.tsx">
<violation number="1" location="apps/app/src/components/risks/treatment-plan/DescriptionEditor.tsx:223">
P2: Adding `onSettled` to this effect's deps can cause duplicate terminal callbacks. Once `status` reaches a terminal value (e.g. `'COMPLETED'`), it stays there — any change to `onSettled`'s reference will re-trigger the effect and call the callback again. Consider adding a `settledRef` guard so `onSettled` is invoked at most once per terminal status.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
Re-trigger cubic
| onSettled?.({ success: false, reason: reasons[status] ?? 'The AI run failed.' }); | ||
| } | ||
| }, [status]); // eslint-disable-line react-hooks/exhaustive-deps | ||
| }, [status, onSettled]); |
There was a problem hiding this comment.
P2: Adding onSettled to this effect's deps can cause duplicate terminal callbacks. Once status reaches a terminal value (e.g. 'COMPLETED'), it stays there — any change to onSettled's reference will re-trigger the effect and call the callback again. Consider adding a settledRef guard so onSettled is invoked at most once per terminal status.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/app/src/components/risks/treatment-plan/DescriptionEditor.tsx, line 223:
<comment>Adding `onSettled` to this effect's deps can cause duplicate terminal callbacks. Once `status` reaches a terminal value (e.g. `'COMPLETED'`), it stays there — any change to `onSettled`'s reference will re-trigger the effect and call the callback again. Consider adding a `settledRef` guard so `onSettled` is invoked at most once per terminal status.</comment>
<file context>
@@ -309,7 +220,7 @@ function RegenProgress({
onSettled?.({ success: false, reason: reasons[status] ?? 'The AI run failed.' });
}
- }, [status]); // eslint-disable-line react-hooks/exhaustive-deps
+ }, [status, onSettled]);
const { headline, sub } = regenRun
</file context>
|
🎉 This PR is included in version 3.55.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.
Summary by cubic
Fixes invite emails to send one combined app+portal invite when appropriate and stops treatment plan text from disappearing when switching strategies; also hides generation for non‑Mitigate strategies.
Bug Fixes
Refactors
rolesHaveAppAccessandsendInviteEmails; switched invite paths to parameter objects.InviteEmailto accept an optionalportalLink.DescriptionEditorto adraft | nullstate; remount viakey={strategy}and makeonRegenerateoptional.Written for commit 9b052f5. Summary will update on new commits. Review in cubic