-
-
Notifications
You must be signed in to change notification settings - Fork 180
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
Change Message#edit and add editContent and editEmbed methods #977
base: master
Are you sure you want to change the base?
Conversation
Since it is closely related to the concern of changing message content, it's fine to make those changes in the same PR. I've skimmed over the changes and noticed that while both message content and embeds are mentioned, the effects on attachments are not documented. Do those need to be considered as well or are they entirely separate from content/embeds? |
@KILLEliteMaste what's the reasoning to do this silently breaking change? |
It's been some time since I have created the issue so I can not 100% recall what I thought back then. iirc it was because of the naming of the methods. If we want to have co existing |
In an ideal world, yes. But in reality mayb 5% of the people read changelogs and most of them don't know their code inside-out unless it is a very small project. Such a silent change in documented behavior is imho one of the worst things you can do as a library. @Bastian what's your opinion on this? |
We do have a heavily breaking release ahead, but I see your point Vampire. Under different circumstances I'd honestly not care for the breakage, but deleted embeds and message contents could not be restored and that would be on us. If we can neither find better names for the methods nor make the changes appropriately visible, we can consider marking the methods as deprecated with an appropriate message and only adding the new methods, referring to them if people wish to keep the old behavior. Then we'd have to hold off on changing Message#edit until one or two more releases. That way only people who skipped multiple versions with tons of breaking changes would run into problems. |
Don't get me wrong, I don't have problems with breaking changes. |
True. That's why I suggested deprecating the methods in preparation for the then-not-so-silent breaking change and delay the change, if we don't find a better. If the methods are deprecated for 1-3 releases (depending on how often they come) far more people will be made aware of the change ahead of time. That would be the best way to do our due diligence if we want that change and can't make it non-sneaky. |
Since there doesn't seem to be a consensus on what to do at the moment, would it be alright if I go ahead and make the bug fix I mentioned a separate pull request? So that it can be considered separately regardless of what is decided on later. |
I do agree that a silent breaking change should be an absolute exception. This is not important enough to justify it. I think, for now we should add It might also be a good idea to allow the |
I am fine with that. Just thought it would be nice to have both behaviors (updating/replacing) a message without having to create a MessageBuilder. For that reason the issue was initially created. |
For cases where edit changes both the content and embed, should there be a new |
I wouldn't add a
|
Thank you for the clarification!
When generated, the Javadoc reads as:
Should I handle the Javadoc differently, or is this alright? |
This PR addresses #822 and changes
Message#edit
to replace the entire message with new content or embeds. It also adds methodseditContent
andeditEmbed
to only update content or embeds without changing other parts of the message.Currently,
MessageEventImpl#editMessage
usesMessage#edit
. ShouldeditMessage
use the newedit
method where the entire message is replaced, or should it only calleditContent
oreditEmbed
?I also ran into a bug where methods that call
edit(String channelId, String messageId, String content, boolean updateContent, List<EmbedBuilder> embeds, boolean updateEmbed)
inUncachedMessageUtil
always change both the content and embeds even if theupdateContent
andupdateEmbed
arguments are false. Should I go ahead and fix this in this PR, or should I make this a separate issue?