Sponge: Issues removing custom data

Created on 27 Feb 2017  路  6Comments  路  Source: SpongePowered/Sponge

Currently, if a plugin is removed that has assigned custom data to a player and the player joins, an error gets outputted to the console every single time. This can annoy server owners, and sway developers away from using custom data, which in my opinion is an awesome feature of Sponge. There are a few solutions that could possibly be implemented, listed below.

  1. Only output the error once, the first time the missing class is found
  2. Always put the warnings in the log files, but never in the console
  3. Delete the data once it is encountered

    • Possibly allow plugins to specify whether the data should be deleted or not



      • If plugin says to keep it, don't display the error



  4. Add a 'purge' command that can remove custom data from a certain plugin,

    • This could possibly flag the data for removal, next time it is encountered delete it

If you have any other ideas or comments please submit them!

data

Most helpful comment

Only output the error once, the first time the missing class is found

Currently it will emit only once the data fails to load, per entity that fails to load

Always put the warnings in the log files, but never in the console

Somewhat difficult to do to only put it in the log files (would have to rely on debugging options). Perhaps @Minecrell can assist with configuring it.

Delete the data once it is encountered

Data is deleted currently once encountered on that entity. If it fails to load, it isn't loaded or temporarily stored again. Other entities that have not loaded will still emit the error once it is attempted to load again.

Add a 'purge' command that can remove custom data from a certain plugin,

Very dangerous, but would have to be something stored on the world as purging all existing entities is impossible with unloaded chunks and/or players.

All in all, valid notes and will be resolved when I tackle the redesign in persisting of custom data and how it's indexed/id'ed. There's an issue somewhere that will be applicable to this where I document some of the issues with custom data. Might be in the API.

All 6 comments

Only output the error once, the first time the missing class is found

Currently it will emit only once the data fails to load, per entity that fails to load

Always put the warnings in the log files, but never in the console

Somewhat difficult to do to only put it in the log files (would have to rely on debugging options). Perhaps @Minecrell can assist with configuring it.

Delete the data once it is encountered

Data is deleted currently once encountered on that entity. If it fails to load, it isn't loaded or temporarily stored again. Other entities that have not loaded will still emit the error once it is attempted to load again.

Add a 'purge' command that can remove custom data from a certain plugin,

Very dangerous, but would have to be something stored on the world as purging all existing entities is impossible with unloaded chunks and/or players.

All in all, valid notes and will be resolved when I tackle the redesign in persisting of custom data and how it's indexed/id'ed. There's an issue somewhere that will be applicable to this where I document some of the issues with custom data. Might be in the API.

Thanks for the response @gabizou! I have a question about your statement that currently it will emit the error only once per entity that fails. If I assign the data to a player and then remove the plugin, no matter how many times I restart the server and disconnect and rejoin, the error still shows. Are players an exception to this rule?

If I assign the data to a player and then remove the plugin, no matter how many times I restart the server and disconnect and rejoin, the error still shows. Are players an exception to this rule?

Quite possibly if the player's data has not been saved without the custom data after it failed to load, then it will continue to emit that error. I'm working on a new serialization strategy with possibly a special log/config that will highlight what data is to be removed, what data was noticed to be removed etc. It will have to of course include a command to highlight all registered data as a possibility to remove it for future startups/loads, something of course permission based since it is not something every user should be able to execute.

Deleting data because a plugin fails to load is pretty bad behaviour...

@gabizou: Okay, thanks!

@Deamon5550: Yes I agree, but that is not necessarily what has to happen with the new system. According to gabizou's first comment, that is what currently happens. I just left it on the possibilities list anyways, even though it may not be the best option.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

XakepSDK picture XakepSDK  路  4Comments

Xemiru picture Xemiru  路  3Comments

ImMorpheus picture ImMorpheus  路  4Comments

therealmikz picture therealmikz  路  4Comments

jeffreykog picture jeffreykog  路  4Comments