Releases: PaperMtn/slack-watchman
Releases · PaperMtn/slack-watchman
Slack Watchman - 4.6.0
Changed
- [High] Message and file workers now cache
users.infoandconversations.infolookups by ID for the lifetime of the worker, eliminating redundant API calls per match. Fixes #117 - [High]
find_messagesandfind_filesnow use a boundedmultiprocessing.Pool(capped at 8) instead of oneProcessper search string, preventing memory and file-descriptor usage from scaling with signature size. Fixes #113 - [High] Pool workers now construct their own
SlackClientvia_init_worker_clientinstead of unpickling the parent client, preserving connection pool and retry config across workers. Fixes #114 - [High]
SlackClient.__init__accepts new keyword-onlysession_tokenandcookie_dictparameters, used by pool workers to skip re-running_get_session_tokenon startup. - [High]
find_messagesandfind_filesnow share a singlemultiprocessing.Managerper call, replacing three per-call managers that leaked until GC. Fixes #116
Fixed
- [Critical] Worker exceptions (rate-limit exhaustion, malformed payloads,
AttributeError) are now caught and reported via a sharederrorslist instead of silently killing the child process. Fixes #108 - [Critical]
_multipro_message_workerno longer crashes on messages with nochannelfield (DMs, tombstoned messages, bot events). Fixes #109 - [Critical]
_multipro_file_workerno longer crashes when a file'snameorfiletypeisNone(deleted/redacted/tombstoned states). Fixes #110 - [Critical]
main()error handler no longer crashes withAttributeErrorwhen an exception is raised beforeinit_loggerruns; falls back totraceback.print_exc()when the logger is uninitialised. Fixes #111 - [High]
SlackClient._make_requestnow honours theRetry-Afterheader on 429s (falling back to 90s), loops back through_make_requestfor consecutive 429s, and raises after a configurable retry cap. Fixes #115 - [Medium] Canvas URLs are now built via
_build_canvas_url(), which normalises the trailing slash on the workspace URL before concatenation. Fixes #126 - [Medium]
after:query timeframes are now computed in UTC (time.gmtime) instead of local time, fixing off-by-one-day windows on CI/cloud hosts; refactored into a_compute_timeframe()helper. Fixes #125 - [Medium]
find_auth_informationreturn type widened toDict[str, Any] | Noneto reflect the actual mixed-type payload. Fixes #124 - [Medium]
find_auth_informationnow catchesRequestException,JSONDecodeError, andAttributeError, returningNonewith aWARNINGinstead of aborting the scan on transient scrape failures. Fixes #123 - [Medium]
find_messagesandfind_filesnow explicitly return[]on no-match and exception paths instead of implicitNone. Fixes #118 - [Medium]
_multipro_file_workerno longer appends a duplicate result persig.file_typesentry; replaced per-type loop with a singleany()check. Fixes #119 - [Medium] Removed dead
is_dataclassguard and unuseddataclassesimport from_resolve_file_user. Fixes #120 - [Medium]
_multipro_message_workernow skips messages with notextinstead of coercingNoneto the string'None', preventing false positives on attachment-only and system messages. Fixes #122 - [Medium]
_multipro_message_workernow compiles each pattern once per worker and reuses theMatchobject, eliminating per-message recompilation and a duplicatesearchcall on the match path. Fixes #121 - [Low]
cursor_api_searchnow updatescursoronce per page after items are collected, fixing a potential infinite loop on empty pages with a non-emptynext_cursor. - [Low]
OUTPUT_LOGGERannotation in__init__.pywidened toStdoutLogger | JSONLogger. - [Low] Added explicit parentheses to
if everything or (not pii and not secrets):for readability; no behaviour change.
Slack Watchman - 4.5.0
Fixed
- Canvas results in
StdoutLoggerwere rendered with the redUSERcolour scheme becausemsg_levelwas set to'USER'instead of'CANVAS'. Added a dedicatedCANVASstyle branch inlog_to_stdout. Fixes #90 - Fixed
AttributeErrorcrash inStdoutLoggerwhen logging file results with no resolved user. The user dict is now coerced via(message.get('user') or {})before readingdisplay_name/email. Fixes #91 - Removed pointless retry on
log_to_stdoutexception inStdoutLogger.log. The previous handler retried with identical arguments and could only fail the same way; replaced with a single contextual error message. Fixes #92 (thanks @SAY-5) - A formatting failure inside
StdoutLogger.log_to_stdoutno longer terminates the process when debug mode is enabled. Thesys.exit(1)call has been removed; the traceback is still printed in debug mode and the scan continues. Fixes #95 JSONLoggerno longer subclasseslogging.Logger(the inheritance was unused — every emission already went throughself.logger) and no longer stacks duplicate handlers when instantiated more than once.addHandleris now guarded so the process-wide singleton fromlogging.getLogger('Slack Watchman')keeps a single handler. Fixes #98JSONLogger.lognow matchesWORKSPACE_PROBE(the level the caller actually passes) instead ofWORKSPACE_PROBE_INFORMATION. Probe results were silently falling through to the catch-allelsebranch and being emitted asCRITICALwith the wrong formatter. Fixes #99JSONLogger.lognow has explicitWARNING,ERROR, andCRITICALbranches that call the matchingself.logger.warning/error/criticalmethod. Previously all three (and any unknown level) hit the catch-allelseand were emitted asCRITICAL, so JSON output diverged fromStdoutLoggerand lost severity information. Fixes #100export_csvnow returns aboolindicating whether the CSV was written, and its callers in__init__.pylog aSUCCESSonly on success and anERRORon failure. Previously a write error was swallowed and the user saw aUsers output to CSV file: ...success line for a file that was never written. Also corrected the channels CSV success message (it was incorrectly labelledUsers output to CSV file). Fixes #102export_csvnow guards against empty input. The previousdataclasses.asdict(export_data[0])would raiseIndexError, which was hidden by the bareexceptand reported only as a strayprintline. Empty input now returnsFalsewithout opening a file. Fixes #103
Removed
- Redundant
f.close()call inexport_csvafter thewith open(...) as f:block (the context manager already closes the file). Fixes #104
Changed
- Converted the
notify_typecascade inStdoutLogger.logfrom a series of independentifs to anelifchain, since the branches are mutually exclusive. Avoids unnecessary string comparisons on every log call. Fixes #94 - Hoisted the colourising regexes (
_TYPE_COLORER,_HEADER_WORDS) inloggers.pyto module-level constants instead of recompiling them on everylog_to_stdoutcall. Fixes #96 - Replaced the 13 near-identical
elifcolour branches inStdoutLogger.log_to_stdoutwith a_LEVEL_STYLESdict lookup. Behaviour is unchanged for every existing level. Fixes #97 - Replaced the per-call
handler.setFormattermutation inJSONLogger.logwith a single_JSONFormatterthat builds the JSON envelope fromrecord.msgand anextra-suppliedlog_level. Eliminates the eight*_formatattributes, removes the not-thread-safe handler state swap, and keeps the JSON schema unchanged for every existing level. Fixes #101
Slack Watchman - 4.4.5
Changed
- Updated dependabot.yml to created PRs against
developbranch instead ofmaaster - Dependabot updates:
requestsupdated to2.33.1pygmentsupdated to2.20.0pytestupdated to9.0.3
Slack Watchman - 4.4.4
Added
- Added GitHub Action to test release notes and version tag for GitHub releases
Changed
- Dependabot updates
requestsupdated to2.33.0
- Update GitHub Actions that use Node.js 20 to the latest versions to support Node.js 24
Fixed
- Fixed broken link to Slack Cookie Authentication blog post in README (raised in [#82] by @emilstahl)
Slack Watchman - 4.4.3
Changed
- Dependabot updates
urllib3updated to2.6.0
Slack Watchman - 4.4.2
Added
- Added
.github/dependabot.ymlwith configuration for Dependabot:- Use
developas target branch - Update both
pyproject.tomlandpoetry.lock
- Use
- README updated to recommend using
pipxfor installation
Fixed
- Fixed issue with Poetry build arguments in Dockerfile, which was causing the build to fail.
Changed
- Modified signature download process to use
requestsinstead ofurllib, which is more robust and provides better SSL handling. This addresses the issue raised in #74 - Dependabot updates
urllib3updated to2.5.0requestsupdated to2.32.4
Slack Watchman - 4.4.1
Fixed
- Fixed a bug where an exception was raised when no suppressed signatures were passed. Fixes #66
- Fixed error when creating a Workspace object using the response from the Slack API. Validation was expecting a
bool, but in some instances, a string was being returned. Fixes #68 - Fixed bug where the incorrect error message was being passed when environment variables were not set. Fixes #67
Slack Watchman - 4.4.0
Added
- Ability to disable signatures by their ID in the
watchman.confconfig file.- These signatures will not be used when running Slack Watchman
- Signature IDs for each signature can be found in the Watchman Signatures repository
- App manifest JSON file for creating the Slack Watchman Slack application added in
docs/app_manifest.json - Pylint configuration and implement fixes and recommendations based on findings
- Added Pylint checks in GitHub actions
- Additional tests added:
- Unit tests for remaining non-model modules
- Integration tests for slack_client.py
Fixed
- Bug where variables were not being imported from watchman.conf config file
Slack Watchman - 4.3.0
Changed
- Timestamps are now in UTC across all logging for consistency
- Refactor some commonly used functions into a utils module
- More general code cleanup and refactoring
Fixed
- Fixed a few bugs with models for User, Workspace and Messages not picking up all values
Added
- GitHub actions for Python tests and Docker build and run testing
- Implemented unit tests for models
Slack Watchman - 4.2.0
Added
- Added enumeration of conversations with populated Canvases attached. These can contain sensitive information, and are worth reviewing.
- Added join domain to unauthenticated probe. This is the link to use to sign into a Workspace if you have an email with one of the approved domains.