Skip to content

[comp] Production Deploy#2859

Merged
Marfuen merged 3 commits into
releasefrom
main
May 15, 2026
Merged

[comp] Production Deploy#2859
Marfuen merged 3 commits into
releasefrom
main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 15, 2026

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

    • Admin+employee with portal checked: send a single app invite that includes the portal link.
    • Employee-only with portal: send portal-only email; admin-only: send app invite without portal link.
    • Tightened role checks (auditors cannot assign privileged roles; employee callers get per-invite errors).
    • Treatment plan description no longer resets when switching strategies; hide "Generate/Regenerate" for non‑Mitigate.
  • Refactors

    • Added rolesHaveAppAccess and sendInviteEmails; switched invite paths to parameter objects.
    • Updated InviteEmail to accept an optional portalLink.
    • Simplified DescriptionEditor to a draft | null state; remount via key={strategy} and make onRegenerate optional.

Written for commit 9b052f5. Summary will update on new commits. Review in cubic

github-actions Bot and others added 2 commits May 15, 2026 14:57
…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>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

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

Project Deployment Actions Updated (UTC)
app (staging) Ready Ready Preview, Comment May 15, 2026 4:20pm
comp-framework-editor (staging) Ready Ready Preview, Comment May 15, 2026 4:20pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
portal (staging) Skipped Skipped May 15, 2026 4:20pm

Request Review

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 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

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>
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.

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]);
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot May 15, 2026

Choose a reason for hiding this comment

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

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>
Fix with Cubic

@Marfuen Marfuen merged commit 062b83f into release May 15, 2026
13 checks passed
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.55.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants