feat(server/storage): emit characterDeleted when a character is deleted - #779
Merged
ChatDisabled merged 1 commit intoSep 30, 2026
Conversation
Fire qbx_core:server:characterDeleted with the citizenid from storage.deletePlayer once the transaction succeeds. Emitting it from storage covers every deletion path, including external character resources that call the storage module directly, and lets resources clean up their own per-character data instead of listing their tables in characterDataTables.
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.
Description
Fires
qbx_core:server:characterDeletedwith thecitizenidfromstorage.deletePlayerwhen the deletion succeeds.Emitting it from storage covers every deletion path: the built-in character menu, the
DeleteCharacterexport, and external character resources that call the storage module directly.This lets a resource clean up its own per-character data instead of adding its tables to
characterDataTables. It also covers data the table list cannot express, such as rows keyed by phone number or app accounts, and avoids the first-bootTable 'x' does not exist in databasewarning for resources that create their tables on start.It is a server-only
TriggerEvent.characterDataTablesis unchanged, so this is purely additive.Related Issues
Relates to #398 and #478.
Type of Change
Testing
On a local Qbox server, with a listener in a phone resource that wipes the character's phone data:
storage.deletePlayer: event received, phone data removed.exports.qbx_core:DeleteCharacter: event received, 7 rows across 7 tables removed.Checklist