Skip to content

Commit

Permalink
Merge branch 'master' into bugfix(ui)/incident-select
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 authored Oct 23, 2024
2 parents 0c54b3e + 6651c01 commit 285f97d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dispatch/plugins/dispatch_google/groups/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def add_member(client: Any, group_key: str, email: str, role: str):
def remove_member(client: Any, group_key: str, email: str):
"""Removes member from google group."""
try:
return make_call(client.members(), "delete", groupKey=group_key, memberKey=email)
return make_call(
client.members(), "delete", groupKey=group_key, memberKey=email, propagate_errors=True
)
except HttpError as e:
if e.resp.status in [409]:
log.debug(
Expand Down
11 changes: 11 additions & 0 deletions src/dispatch/plugins/dispatch_slack/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,18 @@ def get_request_handler(request: Request, body: bytes, organization: str) -> Sla
)
async def slack_events(request: Request, organization: str, body: bytes = Depends(get_body)):
"""Handle all incoming Slack events."""

handler = get_request_handler(request=request, body=body, organization=organization)
try:
body_json = json.loads(body)
# if we're getting the url verification request,
# handle it synchronously so that slack api verification works
if body_json.get("type") == "url_verification":
return handler.handle(req=request, body=body)
except json.JSONDecodeError:
pass

# otherwise, handle it asynchronously
task = BackgroundTask(handler.handle, req=request, body=body)
return JSONResponse(
background=task,
Expand Down

0 comments on commit 285f97d

Please sign in to comment.