Ensure Fider Account is Disabled When Main Account is Deleted or Banned #46

Closed
opened 2024-01-14 14:44:51 -06:00 by jimmyb · 1 comment
Owner

When an account on the main website is deleted by the user or banned by the team we need to ensure the account on the Fider end of things is also disabled.

This code should help (https://github.com/getfider/fider/blob/main/app/models/enum/user_status.go). We're likely going to have to run a manual query against the Fider database to update users.status. If the user deletes the account themselves status needs to be set to 2. If an administrator bans the account, then status needs to be set to 3.

Of note, the Fider PostgreSQL database is stored on a remote server from the MyVideoGameList.com website...but I have setup access, cypress.texas.linuxbox.ninja on port 58761. Once we determine the names of the PostgreSQL username and password variables I will add the credentials to the .env file.

When an account on the main website is deleted by the user or banned by the team we need to ensure the account on the Fider end of things is also disabled. This code should help (https://github.com/getfider/fider/blob/main/app/models/enum/user_status.go). We're likely going to have to run a manual query against the Fider database to update `users.status`. If the user deletes the account themselves status needs to be set to `2`. If an administrator bans the account, then status needs to be set to `3`. Of note, the Fider PostgreSQL database is stored on a remote server from the MyVideoGameList.com website...but I have setup access, `cypress.texas.linuxbox.ninja` on port 58761. Once we determine the names of the PostgreSQL username and password variables I will add the credentials to the `.env` file.
jimmyb self-assigned this 2026-06-04 14:43:58 -05:00
Member

Implemented in commit 23b5ed7 (Sync Fider account status on deletion and bans) and pushed to origin/dev.

Notes:

  • Added a dedicated Fider PostgreSQL connection using FIDER_DB_* env vars, defaulting to cypress.texas.linuxbox.ninja:58761.
  • Added SyncFiderUserStatus, which updates Fider users.status directly.
  • Self-service account deletion sets Fider status 2 (deleted).
  • Admin account deletion and admin ban transitions set Fider status 3 (blocked).
  • Matching is email-first using lower(email), then username fallback using lower(name). It does not match on the MVGL user id/reference.
  • Fider sync is non-blocking: missing config, no matching Fider user, or remote query failure logs context and allows the local MVGL delete/ban to finish.
  • Also added Fider user provisioning on successful registration through the Fider API, guarded so missing config or API failure does not block registration.

Verification:

  • vendor/bin/pint --dirty --format agent
  • php artisan test --compact tests/Feature/FiderUserStatusSyncTest.php tests/Feature/AccountDeletionCascadeTest.php tests/Feature/AdminUserProfileInfoTest.php tests/Feature/Settings/ProfileUpdateTest.php tests/Feature/Auth/RegistrationTest.php -> 69 passed, 562 assertions
  • git diff --cached --check
  • Read-only Fider DB smoke test with local .env.local: select 1 succeeded.
  • Read-only schema check confirmed users.email, users.name, and users.status exist.
Implemented in commit 23b5ed7 (`Sync Fider account status on deletion and bans`) and pushed to `origin/dev`. Notes: - Added a dedicated Fider PostgreSQL connection using `FIDER_DB_*` env vars, defaulting to `cypress.texas.linuxbox.ninja:58761`. - Added `SyncFiderUserStatus`, which updates Fider `users.status` directly. - Self-service account deletion sets Fider status `2` (`deleted`). - Admin account deletion and admin ban transitions set Fider status `3` (`blocked`). - Matching is email-first using `lower(email)`, then username fallback using `lower(name)`. It does not match on the MVGL user id/reference. - Fider sync is non-blocking: missing config, no matching Fider user, or remote query failure logs context and allows the local MVGL delete/ban to finish. - Also added Fider user provisioning on successful registration through the Fider API, guarded so missing config or API failure does not block registration. Verification: - `vendor/bin/pint --dirty --format agent` - `php artisan test --compact tests/Feature/FiderUserStatusSyncTest.php tests/Feature/AccountDeletionCascadeTest.php tests/Feature/AdminUserProfileInfoTest.php tests/Feature/Settings/ProfileUpdateTest.php tests/Feature/Auth/RegistrationTest.php` -> 69 passed, 562 assertions - `git diff --cached --check` - Read-only Fider DB smoke test with local `.env.local`: `select 1` succeeded. - Read-only schema check confirmed `users.email`, `users.name`, and `users.status` exist.
Codex 2026-06-04 16:27:12 -05:00
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MyVideoGameList/myvideogamelist.com#46
No description provided.