Allow direct suspension without requiring flagging first#4364
Merged
Allow direct suspension without requiring flagging first#4364
Conversation
78c515f to
01ffb32
Compare
Expand the user risk state machine to allow suspending users directly from not_reviewed, compliant, and cross-flag states. Flagging remains available as an optional graduated response but is no longer a prerequisite for suspension. Simplifies several callers that previously did flag-then-suspend in sequence: suspend_due_to_stripe_risk, Iffy::User::BanService, SuspendUsersWorker, and SuspendAccountsWithPaymentAddressWorker. Closes #4290 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
01ffb32 to
ccc60d9
Compare
Contributor
Author
Local spec results ✅PR-related specs: 15 passed, 0 failures user_spec.rb state machine tests: The 4 new direct-suspension tests all pass. 21 failures in the full user_spec, but all 21 also fail on Ready to merge. |
slavingia
reviewed
Apr 9, 2026
| @@ -40,10 +40,6 @@ def suspend_users_with_same_stripe_fingerprint(suspended_user) | |||
| end | |||
|
|
|||
| def flag_and_suspend_user(user, suspended_user, identifier_type, identifier_value) | |||
The method no longer flags, just suspends.
slavingia
pushed a commit
that referenced
this pull request
Apr 9, 2026
## What Adds the missing `idempotency_key` column and its unique composite index on the `comments` table to `db/schema.rb`, and bumps the schema version to `2026_11_19_011938`. PR #4317 added migration `20261119011938_add_idempotency_key_to_comments.rb` but did not include the corresponding `schema.rb` update. ## Why The missing schema update causes `db:abort_if_pending_migrations` to fire during CI Docker image builds. The CI build runs `bundle exec rake db:setup assets:precompile` — when `db:setup` detects the pending migration, it aborts the rake process before `assets:precompile` can execute. This leaves the Shakapacker manifest empty (`{}`), which causes every test job to fail with: ``` Shakapacker::Manifest::MissingEntryError: Shakapacker can't find email.css ``` All main CI runs since #4317 was merged (2026-04-08) are affected, as well as any branch forked from main after that point (e.g., #4364). --- This PR was implemented with AI assistance using Claude Opus 4.6 and gpt‑5.4 xhigh Co-authored-by: Gianfranco Piana <gianfrancopiana@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
gumclaw
added a commit
that referenced
this pull request
Apr 9, 2026
#4364 expanded suspend_for_fraud to allow direct suspension from not_reviewed, which now triggers add_user_comment requiring author_id or author_name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
not_reviewed,compliant, and cross-flag states (e.g.,flagged_for_tos_violation→suspended_for_fraud)suspend_due_to_stripe_risk,Iffy::User::BanService,SuspendUsersWorker, andSuspendAccountsWithPaymentAddressWorkerflag_for_fraud,flag_for_tos_violation) are preserved for graduated response — they're now optional, not eliminatedCloses #4290
Test plan
not_reviewedandcompliantstates worksflagged_for_tos_violation→suspended_for_fraud) works🤖 Generated with Claude Code