Fix program invite crash when signed in as a different partner #4675
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.44) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.44 · 262 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.333
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #4675"
general
weight: 0.35
pepeladeira
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Program invitation links now carry the invited email through registration and return people to the invitation afterward.
When the signed-in email differs from the invited email and the signed-in user has no enrollment in the program, a prompt offers the option to continue registration with the invited email.
People without a profile or required partner setup are directed to onboarding before continuing to a program invitation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---
How to test
1. From the repo root, run
pnpm dev.2. Sign in at http://partners.localhost:8888/login as
partner1@dub-internal-test.com.3. Open an invite link in the shape sent before this change. The address is only on the register link:
http://partners.localhost:8888/acme/register?email=other-partner%40example.com&next=/programs/acme/invite
4. You land on the Acme invitation for that other address.
- The heading is This invitation is for other-partner@example.com.
- The text says you are signed in as partner1@dub-internal-test.com and to sign in with the invited email.
- The button is Continue as other-partner@example.com.
- Accept invite and Decline are not on the page.
- The page is not an application error.
5. Click Continue as other-partner@example.com.
- The page is Create your Dub Partner account for Acme.
- Email is filled with
other-partner@example.com.- Sign Up and Continue with Google are on the page.
6. Sign in again as
partner1@dub-internal-test.com. Open http://partners.localhost:8888/programs/acme/invite, which is the same page as Learn more on an invitation. Then open http://partners.localhost:8888/programs/acme/invite?email=partner1@dub-internal-test.com.- Neither URL shows This invitation is for.
- Both show the Acme program page: Program unavailable and You have been banned from this program.