← Back to Pull requests

Let partners update their country from profile settings #4632

Closed
unknown closed this pull request without merging on Oct 08, 2026 18:37 UTC
View on GitHub
unknown unknown commented on Oct 06, 2026 22:10 UTC
Author

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

Summary by CodeRabbit

New Features
US-based partners can change their country in profile settings after confirming the change. Partners outside the US are directed to contact support.
Support chat provides country-specific guidance on changing a partner’s country.
Important Changes
Changing a country clears payout details, which may need to be entered again, and is unavailable while a payout is processing.
Partners with identity verification may be asked to complete country-change verification.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---

How to test

1. Sign in to http://partners.localhost:8888 as a partner of the Acme program whose country is United States. Open Profile. If Country is locked, set it to United States from Network Partners in admin first (step 6), then come back here.
2. Open http://localhost:8888/embed/support-chat?variant=embedded while signed in on http://localhost:8888 as that same user. Choose Partner (partners.dub.co). If it asks which program this is about, choose Acme. Ask to change your partner profile country.
- The reply tells you to update it at https://partners.dub.co/profile.
- No ticket form appears.
- Asking which countries support payouts still answers from the docs.
- Choosing Workspace (app.dub.co) and the acme workspace does not send you to the partner country control.
3. On Profile, under Basic information, open Country, choose Canada, and click Save changes. Click Cancel.
- The Updating your country dialog closes.
- Country stays United States.
- There is no "Your profile has been updated." toast.
4. Choose Canada again, click Save changes, then I acknowledge. Reload Profile.
- A toast says "Your profile has been updated."
- Country shows Canada and does not open.
- Hovering it shows "Your profile country is based on your current location and cannot be changed. If you need to update your country, please contact support." and Contact support.
- A connected payout method is cleared, and the sidebar shows Connect payout method.
- Click Save changes again without changing Country. The country dialog stays closed, the profile still saves, and Country stays Canada.
5. Ask the support chat to change your partner profile country again.
- The reply says you cannot change it yourself and names Canada.
- A ticket form is on screen, with Submit ticket.
- The ticket is not created until Submit ticket is clicked. Leave it unsent.
6. Sign in to http://admin.localhost:8888, open Partners, then Network Partners, and open that partner. The address bar includes partnerId. Under Country, choose United States, click Update, then Update country.
- The dialog is titled Update partner country and says this will reset the connected Stripe account and payout settings.
- Reload http://partners.localhost:8888/profile. Country shows United States and opens again.
7. This step applies only when that partner has already verified their identity. Saving the country queues a QStash job. Without ngrok, QStash cannot reach your local app, so call the cron route yourself. In local dev, the route does not check the QStash signature. Use the partnerId from the admin address bar.

   curl -X POST http://localhost:8888/api/cron/partners/verify-country-change \
     -H "content-type: application/json" \
     -d '{"partnerId":"<partner id>"}'
   

- If the new country does not match the verified document, identity verification is cleared and MailHog at http://localhost:8025 shows "Identity re-verification required".
- A partner who has not verified their identity can skip this step. Their country change in step 4 does not depend on it.

Diff: 496 lines (+372 / -124) across 6 files Reviewer: pepeladeira Review duration: 2666m
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 496 lines diff across 6 files
0.52
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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.371
Shallow Review Depth shallow_review_depth
0.289
Ai Authored ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #4632"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 52.5% (MEDIUM) · Higher = larger blast radius
52.5%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 20.7% · Safe to merge
20.7%
Repository