Skip to content

Allow deletion of legacy suspended organizations - #2475

Draft
niemyjski wants to merge 7 commits into
mainfrom
issue/organization-delete-suspended-user-id
Draft

Allow deletion of legacy suspended organizations#2475
niemyjski wants to merge 7 commits into
mainfrom
issue/organization-delete-suspended-user-id

Conversation

@niemyjski

@niemyjski niemyjski commented Aug 14, 2026

Copy link
Copy Markdown
Member

What changed

Migrate the exact legacy Stripe suspension marker before normal organization writes validate it.

Evidence

  • Git history shows the old Stripe event handler wrote the literal "Stripe" into SuspendedByUserId in both suspension paths.
  • A later Stripe billing change introduced the all-zero 24-character system user ID used today.
  • Existing SystemUserId constants for OAuth and predefined saved views are different IDs, so they are not interchangeable.

Fix

  • Centralize the Stripe-specific legacy and current IDs.
  • Add version 7 as a versioned, resumable migration.
  • Scan suspended organizations, including soft-deleted records, through the existing typed organization repository.
  • Filter the unmapped legacy field from loaded source and replace only the exact legacy marker.
  • Refresh the current organization index after writes so reruns and subsequent API requests observe the migration.
  • Preserve suspension metadata so deleting and restoring an organization does not silently clear its suspension state.

Verification

  • Five integration tests cover historical conversion, non-target records, soft-deleted records, idempotent reruns, and more than one migration page.
  • Organization endpoint regression coverage verifies suspension state survives delete and restore.
  • Migration registration test verifies version 7 and VersionedAndResumable registration.
  • dotnet build Exceptionless.slnx --no-restore -m:1
  • Hosted Build run 31840728876 passed all required checks.

No production identifiers or customer data are included.

@niemyjski niemyjski self-assigned this Aug 14, 2026
@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.Insulation 37% 35% 286
Exceptionless.Core 75% 67% 10012
Exceptionless.Web 85% 69% 7033
Exceptionless.AppHost 38% 40% 139
Summary 78% (23525 / 30333) 67% (11041 / 16544) 17470

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.

1 participant