Skip to content

Conversation

@dgw
Copy link
Member

@dgw dgw commented Oct 13, 2022

Description

Short sleep does not make me a great comprehensive reader of specs, but commands that are 1) sent from the server to a client and 2) include a (channel/nick), are actually quite rare. The IRC protocol is mostly numeric replies, and very few event types actually refer to a user (nick) or channel.

The idea here, though, is that unless I forgot about an event type that actually is tied to a channel or query (PM) buffer, it is ONLY the new list of COMMANDS_WITH_CONTEXT that should have the sender set to any value other than None.

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make quality and make test)
  • I have tested the functionality of the things this change touches

Notes

Undecided yet if this is enough to call #2331 closed. I remember a discussion about transitioning to a new property called trigger.context or similar, for clarity, but can't find it on the relevant issue. Maybe it was an IRC conversation.

'Breaking Change' label because this could be a spacebar heating incident if anyone relies on the old (buggy) behavior for some weird plugin thing and it needs to be mentioned in the changelog for 8.0.

While updating/adding tests I also found an actual bug in how text gets set (it contradicts Sopel's documentation). TODO comments related. I will work on that next.

Short sleep does not make me a great comprehensive reader of specs, but
commands that are 1) sent from the server to a client and 2) include a
<target> (channel/nick), are actually quite rare. The IRC protocol is
mostly numeric replies, and very few event types actually refer to a
user (nick) or channel.

The idea here, though, is that unless I forgot about an event type that
actually is tied to a channel or query (PM) buffer, it is ONLY the new
list of `COMMANDS_WITH_CONTEXT` that should have the `sender` set to any
value other than `None`.

Haven't yet addressed the fact that `sender` is not the clearest name
for this property, though. Baby steps.

While updating/adding tests I also found an actual bug in how `text`
gets set (it contradicts Sopel's documentation). TODO comments related.
@dgw dgw added the Bugfix Generally, PRs that reference (and fix) one or more issue(s) label Oct 13, 2022
@dgw dgw added this to the 8.0.0 milestone Oct 13, 2022
@dgw dgw requested a review from a team October 13, 2022 19:33
@dgw dgw added the Breaking Change Stuff that probably should be mentioned in a migration guide label Oct 13, 2022
Copy link
Contributor

@Exirel Exirel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm impressed. It's actually quite good: logic is good, code is sane, there are tests! All good to me.

Copy link
Contributor

@SnoopJ SnoopJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice one

Micro-optimization suggested in code review.

Co-authored-by: James Gerity <[email protected]>
@dgw dgw merged commit db2bfc4 into master Oct 14, 2022
@dgw dgw deleted the trigger.sender-consistency branch October 14, 2022 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking Change Stuff that probably should be mentioned in a migration guide Bugfix Generally, PRs that reference (and fix) one or more issue(s) Core/IRC Protocol Handling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants