notify: per-username result counts (fixes #2990) - #3071
Open
SkxOverKill wants to merge 1 commit into
Open
SkxOverKill wants to merge 1 commit into
SkxOverKill wants to merge 1 commit into
Conversation
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.
Summary
Fixes #2990 — the "Search completed with X results" line showed a cumulative total across all usernames (and relied on a fragile
countResults() - 1off-by-one compensation).Root cause
sherlock_project/notify.pyused a module-levelglobvarthat is never reset. A singleQueryNotifyPrintinstance is created once inmain()(sherlock.py:812) and shared across every username scan, so the counter accumulated across scans.Changes
sherlock_project/notify.pyglobvar.self._result_count, initialised in__init__).finish()readsself._result_countdirectly (no extra increment +- 1) and resets it so the next username scan starts from zero.sherlock_project/sherlock.pyquery_notify.finish()inside the per-username loop so each scan prints its own "Search completed with X results" line.tests/test_notify.py— new offline unit tests covering per-instance counts and reset between scans.Verification
2 resultsthen4 results. After the fix:2 resultsthen1 results.pytest tests/test_notify.pypasses (2 passed).py -msubprocess tests that also fail onmaster).