penny-university / penny_university

5 stars 6 forks source link

Limit number of profile pictures in the penny chat reminder #349

Closed mrshwah closed 4 years ago

mrshwah commented 4 years ago

Description

We received an error from sentry while trying to send our Penny Chat reminders for a recent chat with 10 participants.

The request to the Slack API failed.
The server responded with: {'ok': False, 'error': 'invalid_blocks', 'response_metadata': {'messages': ['[ERROR] no more than 10 items allowed [json-pointer:/blocks/4/elements]']}}

After some digging, I found that we are creating a list of profile images to attach to the reminder message, along with a string for how many participants there are. Since we had 10 participants, these images plus the attending string caused the error. We need to limit the number of attendees we show profiles for, and then have an adjusted messaged like "and 3 more attending" if we go over the limit.

Requirements