Skip to content

ENG-3261: close re-invite validation gap and null-email modal render#7963

Open
nreyes-dev wants to merge 3 commits intomainfrom
nreyes/eng-3261
Open

ENG-3261: close re-invite validation gap and null-email modal render#7963
nreyes-dev wants to merge 3 commits intomainfrom
nreyes/eng-3261

Conversation

@nreyes-dev
Copy link
Copy Markdown
Contributor

@nreyes-dev nreyes-dev commented Apr 20, 2026

Ticket ENG-3261

Description Of Changes

Follow-up cleanup from #6904 (Re-invite Expired Users). The reinvite endpoint's two-check validation let a disabled user with disabled_reason=None fall through to the service layer, and the reinvite confirmation modal rendered an empty email when user.email_address was null. Both paths are now closed.

Code Changes

  • Collapsed the two guards in reinvite_user (user_endpoints.py) into if not user.disabled or user.disabled_reason != DisabledReason.pending_invite, closing the disabled_reason=None gap.
  • Guarded the email sentence in ReinviteSection's confirmation modal (EditUserForm.tsx) so it only renders when user.email_address is truthy.
  • Renamed test_reinvite_user_without_invite_record to test_reinvite_disabled_user_without_pending_invite_reason to reflect what the new endpoint guard rejects.
  • Added a new test_reinvite_user_without_invite_record covering a user with disabled_reason=pending_invite but no FidesUserInvite row, preserving service-layer rejection coverage.

Steps to Confirm

  1. Run pytest tests/ops/api/v1/endpoints/test_user_endpoints.py::TestReinviteUser — all reinvite tests pass.
  2. Create an invited user, then set their disabled_reason to NULL directly in the DB. POST /api/v1/user/<user_id>/reinvite returns 400 with "User does not have a pending invitation." (previously the request fell through to the service layer).
  3. For the same user, set email_address to NULL in the DB, open their edit page in the admin UI, and click "Reinvite user". The confirmation modal asks only "Are you sure you want to send a new invitation to ?" with no trailing "…will be sent to ." sentence.
  4. Restore the email; the modal now includes "A new invitation email will be sent to ."

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 20, 2026

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Preview Apr 20, 2026 3:31pm
fides-privacy-center Ignored Ignored Apr 20, 2026 3:31pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

Title Lines Statements Branches Functions
admin-ui Coverage: 8%
6.17% (2709/43842) 5.38% (1340/24893) 4.24% (550/12962)
fides-js Coverage: 78%
78.98% (1962/2484) 65.55% (1214/1852) 72.57% (336/463)
privacy-center Coverage: 88%
85.97% (331/385) 81.36% (179/220) 78.87% (56/71)

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.04%. Comparing base (d8860a9) to head (0d78a2a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7963   +/-   ##
=======================================
  Coverage   85.04%   85.04%           
=======================================
  Files         631      631           
  Lines       41203    41201    -2     
  Branches     4806     4805    -1     
=======================================
- Hits        35040    35039    -1     
  Misses       5071     5071           
+ Partials     1092     1091    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nreyes-dev nreyes-dev changed the title ENG-3261: tighten re-invite user endpoint validation and add UI guard ENG-3261: close re-invite validation gap and null-email modal render Apr 20, 2026
@nreyes-dev nreyes-dev marked this pull request as ready for review April 20, 2026 16:20
@nreyes-dev nreyes-dev requested review from a team as code owners April 20, 2026 16:20
@nreyes-dev nreyes-dev requested review from johnewart and kruulik and removed request for a team April 20, 2026 16:20
@nreyes-dev
Copy link
Copy Markdown
Contributor Author

/code-review

claude[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor

@kruulik kruulik left a comment

Choose a reason for hiding this comment

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

UI portion looks good to me ✅

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants