-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configloader Rework #31
Comments
Simple concept:
Edit 1: I added a |
Moved to V3 as this will be done with a complete makeover of the configuration file system. |
Moved to V2 once again, as this ConfigLoader Rework is needed so badly - Just look at the new ModMail system that was implemented in V2 and how simple it would have looked if the ConfigLoader wouldnt just return JSONObjects but full qualified DataObjects specified for the type of data they contain... |
Quick update on what still has to be done:
Yes, it doesn't only seem like it's a lot, but I thought I might put an update here - also just to calm myself down 😅! |
...and updated data classes according to new comment on #31
Alright, I got bad news: I think we have to code everything again, as data should be stored in ID form and not in some member object, that might become invalid over time. Imagine this: We save a members java object on configuration, this member deletes his account and we try to interact with that saved java object: I do not want to imagine what would happen, if this would happen so we gotta prevent it, by switching to IDs and retrieving the user/member/guild/channel/message every time we need the object. This would happen within the data classes still, but it means rewriting of already completed code... |
This results from a comment I made on #31 in which I explained the problem with saving objects such as Guilds, Roles, Users, Members and so on: They might get deleted, whilst the bot has saved them. In the future the bot will therefore save ids instead of those objects and convert these ids to objects as soon as they are requested from one of the data objects defined within the data classes.
Implementation of background system to, if config files are changed whilst the bot is operating, update all the old configuration files without the bot breaking.
Could be done by saving all the old keys and value-data-types, trying to get the updated versions and on an error update the config files whilst returning castet values so it matches the updated system for now.
The text was updated successfully, but these errors were encountered: