Skip to content

feat(admin): wipe a deleted QBox character's phone data on qbx_core:server:characterDeleted - #300

Open
mur4i wants to merge 1 commit into
Samuels-Development:mainfrom
mri-Qbox-Brasil:feat/qbx-character-deleted
Open

mur4i wants to merge 1 commit into
Samuels-Development:mainfrom
mri-Qbox-Brasil:feat/qbx-character-deleted

Conversation

@mur4i

@mur4i mur4i commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When a character is deleted on QBox, its phone data stays in the database. qbx_core only removes the tables listed in its characterDataTables config, and the phone's tables are not on that list. Even if a server owner added them, that list can only express WHERE citizenid = ? deletes, so it cannot reach what wipeCid handles: app accounts found by creator, handle-keyed social rows, mail logins, and rows keyed by phone number.

qbx_core now emits qbx_core:server:characterDeleted with the citizenid after a successful deletion (Qbox-project/qbx_core#779). It is fired from storage.deletePlayer, so it covers the built-in character menu, exports.qbx_core:DeleteCharacter, and external character resources that call the storage module directly.

This listens for that event on QBox and runs wipeCid for the deleted character, the same cleanup /wipemyphone does. It is a server-only AddEventHandler and is registered only when the detected framework is qbx. On a qbx_core build without the event, nothing fires and behaviour is unchanged.

Type of Change

  • Bug Fix
  • New Feature
  • Improvement / Refactor
  • Performance
  • Documentation
  • Compatibility
  • Other

Related Issues

Related to Qbox-project/qbx_core#779 and #296. #296 adds phone_notif_prefs, phone_bluetooth, phone_wifi and phone_health_daily to wipeCid. Without it, those four tables survive a character deletion too.

Testing

On a local QBox server with MariaDB, we ran an equivalent handler, calling wipeCid on qbx_core:server:characterDeleted, from a separate server file. We deleted characters through the built-in character menu, through an external character resource that calls storage.deletePlayer, and through exports.qbx_core:DeleteCharacter. In each case the handler received the citizenid and the character's phone rows were removed.

  • Tested locally
  • Tested with latest sd-phone
  • Tested with latest ox_lib
  • Tested with latest ox_inventory
  • Multiplayer tested

Breaking Changes

None.


Checklist

  • My code follows the existing style of the project.
  • I have tested my changes.
  • I have updated any necessary documentation. (none needed)
  • I have removed any debug code.
  • This PR does not include unrelated changes.
  • I have verified this works on the latest version of sd-phone.

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