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
fix: remove support for overriding caches that break functionality #6282
fix: remove support for overriding caches that break functionality #6282
Conversation
Co-authored-by: Noel <buechler.noel@outlook.com>
wouldn't it be better to just put it in the docs and/or guide instead of also logging a warning? or at least add a way to disable the warning and why do the typings say |
Because we need |
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.
why not just remove the functionality to override these caches then?
that makes more sense to me than adding a warning not to do it
I disagree with totally removing it; you can still just not use the functionality it breaks if you want |
Although I did add it to the docs, the process warning is a much more present warning. It will only emit the warning once per process run, so up to 5 total warnings. It's more of a reminder like "hey, things are gonna break" and I don't want people just disabling the warning because they saw someone else do it.
Partially what advaith said, but also there's plenty of valid use cases. Maybe you only want to cache channels that can contain messages, that is perfectly fine to do, we just won't be able to support digging out all the little places of the library that break when you do that. |
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.
Just one suggestion, but won't block.
Please describe the changes this PR makes and why it should be merged:
Discord.js is not meant to be cache independent in its current state. The option to override caches is provided but overriding some of these caches will cause major issues internally. Those caches are:
GuildManager
,ChannelManager
,GuildChannelManager
,RoleManager
, andPermissionOverwriteManager
.Unsupported means you can still override said caches, but you do so at your own risk and will not receive help for doing so. Furthermore you will get a process warning when doing so to notify you of this
DO NOT MESS WITH THESE CACHES IF YOU ARE NO 1000% SURE WHAT YOU ARE DOING
Status and versioning classification: