vvanouytsel / jetspotter

MIT License
22 stars 2 forks source link

Slack API Error when block field text is empty #26

Closed rorpage closed 4 months ago

rorpage commented 4 months ago

Describe the bug If an aircraft doesn't have an ImageURL, the formatRegistration method returns an empty string. This creates a block field in the Slack message of:

...
{
  "type": "mrkdwn",
  "text": ""
},
...

To Reproduce Steps to reproduce the behavior:

  1. Add a Slack webhook URL
  2. Run the application
  3. After finding any number of aircraft, the Slack message isn't sent and a 400 message is displayed.

Expected behavior Slack messages should be sent, even if the registration info isn't present.

Screenshots image

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context I was able to verify this issue with the Slack Block Kit Builder. When manually adding in any text into the "Registration" block, it formatted properly.

rorpage commented 4 months ago

Closed with #27