Skip to content

fix: skip action rows with blank player name to prevent write-queue s… - #389

Open
netcrafts wants to merge 1 commit into
QuiltServerTools:masterfrom
netcrafts:fix/blank-player-name
Open

fix: skip action rows with blank player name to prevent write-queue s…#389
netcrafts wants to merge 1 commit into
QuiltServerTools:masterfrom
netcrafts:fix/blank-player-name

Conversation

@netcrafts

Copy link
Copy Markdown
Contributor

What does this change?

Extends the existing skip-and-warn guard in insertActions to also discard actions whose sourceProfile carries a blank name, and renames safe/oversized to valid/invalid so the variable names remain accurate now that two discard conditions exist.

Why?

Under certain conditions — likely a mod generating a player-attributed action for an entity with an incomplete GameProfilegetOrCreatePlayerId attempts to insert a new row into players where NameAndId.name is blank. Because the generic getOrCreateObjectId helper only sets the single column passed to it (player_id), player_name is omitted from the INSERT. MySQL rejects this as player_name is NOT NULL with no default:

java.sql.SQLException: Field 'player_name' doesn't have a default value
Statement(s): INSERT INTO players (first_join, last_join, player_id) VALUES (?, ?, ?)

The exception propagates out of insertActions, the action is never removed from the queue, and the write pipeline stalls retrying the same batch indefinitely.

How?

One extra condition is added to the existing partition predicate:

val (valid, invalid) = actions.partition {
    (it.extraData == null || it.extraData!!.length <= MAX_EXTRA_DATA_BYTES) &&
        (it.sourceProfile == null || it.sourceProfile!!.name.isNotBlank())
}

The invalid.forEach warn block now branches on the cause so each case logs a distinct, actionable message. The warning includes the UUID, which should help identify the source if the issue is encountered again.

@netcrafts
netcrafts requested a review from a team as a code owner August 18, 2026 00:03
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