Truncate long field values in messages going to Discord.

Review Request #13871 — Created May 20, 2024 and submitted

Information

rbintegrations
release-4.x

Reviewers

Discord's Slack-compatible WebHook endpoint has a limitation that Slack
does not. If a field value is over 1024 characters, Discord will refuse
to post the message, responding with a very unhelpful error payload.

Through some trial and error, it appears that they limit the length of
any field value to 1024 characters.

BaseChatIntegration will now pass any field value text through
format_field_text(), which is normally a no-op. In the case of
Discord, the text is truncated and ellipsized if over 1024 bytes.

This should fix posting updates with long descriptions.

Unit tests passed.

Ran some simulations with known failing review requests, and
successfully posted them to Discord.

Summary ID
Truncate long field values in messages going to Discord.
Discord's Slack-compatible WebHook endpoint has a limitation that Slack does not. If a field value is over 1024 characters, Discord will refuse to post the message, responding with a very unhelpful error payload. Through some trial and error, it appears that they limit the length of any field value to 1024 characters. `BaseChatIntegration` will now pass any field value text through `format_field_text()`, which is normally a no-op. In the case of Discord, the text is truncated and ellipsized if over 1024 bytes. This should fix posting updates with long descriptions.
48bc8b63da51683b69b5c0dd596caba431ff1b22
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.x (e835b8c)