pilosus / dienstplan

Slack bot app for duty rotations
https://dienstplan-slack.pilosus.org
Other
21 stars 1 forks source link

Remove `team` field in request context as it's not used #26

Closed pilosus closed 2 years ago

pilosus commented 2 years ago

Originally team field in request context was deemed to make sure team id + channel id comprise a unique id for the channel. But team id isn't used in posting messages with the Slack public API. So we don't use team id either. The problem arises when app_mention event lacks team field (e.g. Slack's Workflow Builder doesn't use it). It results in spec validation failure for the legitimate commands, e.g.:

INFO  dienstplan.commands - Parsed command: {:context {:channel "C123", :team nil, :ts "1641884435.029700"}, :command :who, :args {:name "duty"}, :error "Usage:\n@dienstplan who <rotation name>\n\nExample:\n@dienstplan who backend-rota"}

although the command and its args have been parsed correctly.

Let's remove team from the request context