Conversation
…erver:characterDeleted
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
When a character is deleted on QBox, its phone data stays in the database.
qbx_coreonly removes the tables listed in itscharacterDataTablesconfig, and the phone's tables are not on that list. Even if a server owner added them, that list can only expressWHERE citizenid = ?deletes, so it cannot reach whatwipeCidhandles: app accounts found by creator, handle-keyed social rows, mail logins, and rows keyed by phone number.qbx_corenow emitsqbx_core:server:characterDeletedwith thecitizenidafter a successful deletion (Qbox-project/qbx_core#779). It is fired fromstorage.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
wipeCidfor the deleted character, the same cleanup/wipemyphonedoes. It is a server-onlyAddEventHandlerand is registered only when the detected framework isqbx. On aqbx_corebuild without the event, nothing fires and behaviour is unchanged.Type of Change
Related Issues
Related to Qbox-project/qbx_core#779 and #296. #296 adds
phone_notif_prefs,phone_bluetooth,phone_wifiandphone_health_dailytowipeCid. Without it, those four tables survive a character deletion too.Testing
On a local QBox server with MariaDB, we ran an equivalent handler, calling
wipeCidonqbx_core:server:characterDeleted, from a separate server file. We deleted characters through the built-in character menu, through an external character resource that callsstorage.deletePlayer, and throughexports.qbx_core:DeleteCharacter. In each case the handler received thecitizenidand the character's phone rows were removed.Breaking Changes
None.
Checklist