-
Notifications
You must be signed in to change notification settings - Fork 60
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
Sending more than ~99 lines to Slack fails with too_many_attachments #238
Comments
Thanks for testing these! |
Also, you can use the shoutrrr CLI ( |
Thanks for that. Being able to feed via stdin was exactly the reason I shied from the CLI, good to hear it's coming soon! |
@justinsteven ref #243 |
Inclues fixes for: * containrrr/shoutrrr#238 * Sending more than ~99 lines to Slack fails with too_many_attachments * containrrr/shoutrrr#240 * Sending 2000, 4000 or 6000 characters to Discord panics * containrrr/shoutrrr#244 * Sending 1999, 3999 or 5999 characters to Discord panics * (Incomplete fix for the above)
* go.mod update to 1.17 and dependency synchronisation * Docker file update to use go 1.18 and "go install" instead of "go get" * Minor documentation updates * GitHub action version updates * goreleaser-action version fix * Allow -bulk to work with stdin * go mod update * replaced helper function with lib * Do chunked reading in -bulk mode Reduces memory usage when input is big Also includes the fix for #134 (makes testing easier) * Move bulkSplitter to util.go * Remove unused function * Refactor bulkSplitter Simplified looping. Also, we no longer truncate mid-line unless it's the first line of a chunk (in such a case we have no option but to truncate). A truncated line will be followed by an ellipsis. Otherwise we're splitting chunks at the last possible newline without exceeding charLimit for that chunk. * Bugfix: Always remove trailing newlines * Bump shoutrrr for long message fixes Inclues fixes for: * containrrr/shoutrrr#238 * Sending more than ~99 lines to Slack fails with too_many_attachments * containrrr/shoutrrr#240 * Sending 2000, 4000 or 6000 characters to Discord panics * containrrr/shoutrrr#244 * Sending 1999, 3999 or 5999 characters to Discord panics * (Incomplete fix for the above) * minor changes Co-authored-by: Sandeep Singh <sandeep@projectdiscovery.io> Co-authored-by: forgedhallpass <13679401+forgedhallpass@users.noreply.github.com> Co-authored-by: mzack <marco.rivoli.nvh@gmail.com>
What happens
When sending 99 lines to Slack, shoutrrr splits on newline and successfully sends it as 99 attachments
When sending 100 lines to Slack, shoutrrr splits on newline and attempts to send it as 100 attachments. This fails with the err "failed to send slack notification: webhook response: too_many_attachments"
Note that in some of my other testing, sending 100 lines succeeds but 101 lines fails. I have an off-by-one error somewhere.
What is expected
Sending any number of lines to Slack, provided it is within the character limit, succeeds.
Demo
Using the following harness:
Sending 99 lines succeeds:
While sending 100 lines fails:
Note that sending 99 relatively long lines still succeeds, indicating this is a problem caused by line count not character count:
The text was updated successfully, but these errors were encountered: