Conversation
The result counter used a module-level global variable (globvar) that was never reset between username scans. When scanning multiple usernames, the count for each subsequent user included results from all previous ones. Fix: move counter to instance attribute (_result_count) initialized in QueryNotifyPrint.__init__, replacing the fragile module-level global. Fixes sherlock-project#2990
vtino17
force-pushed
the
fix/result-counter
branch
from
August 10, 2026 23:36
c5d2b9a to
e433aa4
Compare
Author
|
I cleaned this branch so it no longer contains the unrelated output-flag change or the accidental pr-body.md file, rebased it onto current master, and added a regression test proving counts are isolated between notifier instances and finish does not increment them. Local result: 1 passed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2990
Problem
The result counter is a module-level global, so counts accumulate across usernames.
finish()also increments the counter and subtracts one, making the behavior dependent on call order.Change
QueryNotifyPrintinstancefinish()read the current count without mutating itRegression test
The test creates two notifier instances and verifies independent totals of two and one; it also proves
finish()does not increment either counter.Local result:
1 passed.