Skip to content

Commit

Permalink
Fixes issues with case messaging (Netflix#3060) (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: kevgliss <[email protected]>
  • Loading branch information
rutvijmehta-harness and kevgliss authored Mar 17, 2023
1 parent 5692e11 commit e16968a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/dispatch/plugins/dispatch_slack/case/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,12 @@ def create_signal_messages(case: Case) -> List[Message]:
Section(fields=[f"*{k.strip()}* \n {v.strip()}" for k, v in chunk]),
)
else:
signal_metadata_blocks.append(
Section(text=item["value"]),
)
messages.append(Message(blocks=signal_metadata_blocks).build()["blocks"])
# remove empty strings
if item["value"]:
signal_metadata_blocks.append(
Section(text=str(item["value"]).strip()),
)

# limit the number of total messages
messages.append(Message(blocks=signal_metadata_blocks[:50]).build()["blocks"])
return messages

0 comments on commit e16968a

Please sign in to comment.