Skip to content
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

coretasks: Major rewrite of MODE handling #1575

Merged
merged 3 commits into from
Apr 30, 2019
Merged

coretasks: Major rewrite of MODE handling #1575

merged 3 commits into from
Apr 30, 2019

Conversation

dgw
Copy link
Member

@dgw dgw commented Apr 27, 2019

Opening this PR early as a draft, to gather feedback from @half-duplex (who reported a possible mode-tracking bug in the 6.6.x series to me) and others who might have more spare time and/or brainpower this weekend than I seem to (so far). 😅

If this turns out to be a productive rewrite, it's a solid reason to release a version 6.6.7 (which is not currently planned). Should it not help anything, I mean what I said in that comment about rewriting the mode tracking again after ISUPPORT parsing (#1536) gets finalized and merged for Sopel 7.

@dgw dgw added the Bugfix Generally, PRs that reference (and fix) one or more issue(s) label Apr 27, 2019
sopel/coretasks.py Outdated Show resolved Hide resolved
@dgw dgw added this to the 6.6.7 milestone Apr 27, 2019
It appears (as observed on a real bot in production) that batched MODE
messages would trip up the old code and assign incorrect privilege
bitmasks depending on the ordering and other factors.

This rewrite is a first attempt at fixing that. Notably, it specifically
bails out if something looks too complicated to parse.

Co-authored-by: mal <mal@sec.gd>
@dgw dgw force-pushed the mode-parsing-revisited branch from 520d2fd to 78b5878 Compare April 27, 2019 02:43
@dgw dgw marked this pull request as ready for review April 27, 2019 02:43
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.

It's great to see a bug fix with some unit-tests! However, I'd like to prevent what I call the "too smart" syndrome.

Tests are dumb things, KISS and DRY are nice, but they mostly don't apply to them. I prefer a test that repeats itself than a test that, by being too smart or too clean, misses its target.

For instance, a SopelWrapper instance is never used multiple times for different Trigger: there is one and only one per Trigger. The same SopelWrapper can be used in multiple commands, but that's another thing!

test/test_coretasks.py Outdated Show resolved Hide resolved
test/test_coretasks.py Outdated Show resolved Hide resolved
test/test_coretasks.py Outdated Show resolved Hide resolved
test/test_coretasks.py Outdated Show resolved Hide resolved
test/test_coretasks.py Outdated Show resolved Hide resolved
test/test_coretasks.py Outdated Show resolved Hide resolved
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.

👍

half-duplex and others added 2 commits April 30, 2019 17:41
Co-authored-by: Florian Strzelecki <florian.strzelecki@gmail.com>
@half-duplex half-duplex force-pushed the mode-parsing-revisited branch from a164bbc to c651804 Compare April 30, 2019 21:42
@dgw dgw merged commit 4032deb into 6.6.x Apr 30, 2019
@dgw dgw deleted the mode-parsing-revisited branch April 30, 2019 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix Generally, PRs that reference (and fix) one or more issue(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants