-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[ModLog] Use custom scopes for ModLog Config #2766
[ModLog] Use custom scopes for ModLog Config #2766
Conversation
Signed-off-by: Toby Harradine <[email protected]>
Signed-off-by: Toby Harradine <[email protected]>
Signed-off-by: Toby Harradine <[email protected]>
PR seems to work, however I think that there is a migration failur, it cannot reference to old mod cases within the |
Thanks, will take a look at it later this afternoon. |
It's been moved to Cog-Creators#2795 Signed-off-by: Toby Harradine <[email protected]>
This PR now depends on #2795 |
Was previously doing it lexicographically, which is wrong. Signed-off-by: Toby Harradine <[email protected]>
…V3/modlog_config_redesign
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR is working as intended. Data is migrated over to custom handler and deleted from the modlog.guild
as it should. Pulling back on old cases works, and continuity in modlog is working as intended.
Modlog is currently the biggest culprit for seriously large documents in the MongoDB backend, since it stores all cases as nested dicts in the guild scope. So, for example, on the Fortnite server, the guild document for @Kowlin's bot has exceeded 8MB.
This PR gives each case its own document. It also does the same for casetypes. Not only does it remove the possibility of the document exceeding the maximum size in MongoDB, it's also just more efficient for all backends.
Other changes
Config Bug
These changes highlighted a bug in Config, which I've fixed here but will probably open a new PR for: when a custom scope uses more than one primary key, but does this with a partial primary key:
conf.custom(SCOPE, primary_key_1).all()
, the defaults will be mixed in with the top-level of the returned dict, even though the actual documents are nested further in.General ModLog improvements
Fixed a bunch of type-hints, and also added more support for when an object related to a case (user, moderator, channel etc.) can't be found (because it was deleted or something rather)