Skip to content

🐛(backend) enforce emoji validation for reactions#1965

Open
maboukerfa wants to merge 1 commit intosuitenumerique:mainfrom
maboukerfa:fix/enforce_emoji
Open

🐛(backend) enforce emoji validation for reactions#1965
maboukerfa wants to merge 1 commit intosuitenumerique:mainfrom
maboukerfa:fix/enforce_emoji

Conversation

@maboukerfa
Copy link
Contributor

@maboukerfa maboukerfa commented Mar 10, 2026

Purpose

This pull request enforces emoji validation in the ReactionSerializer to prevent invalid emoji submissions.

  • Currently we can do such reactions
Screenshot 2026-03-10 at 07 09 24

Proposal

  • Validate emojis in ReactionSerializer (previously accepted any string)
  • Prevents multiple emojis or text uploads in a single reaction

Copy link
Member

@lunika lunika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution.

Just one comment, and it will be good.


def validate_emoji(self, value):
"""Ensure the reaction is a single emoji."""
if not emoji.is_emoji(value):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a warning log here? To ensure that valid emoji are not rejected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a warning log to for the rejected emojis and their corresponding Unicode

Image

Validate emojis in ReactionSerializer (previously accepted
any string), preventing multiple emojis or text uploads in
a single reaction

Signed-off-by: Mohamed El Amine BOUKERFA <boukerfa.ma@gmail.com>
@maboukerfa maboukerfa requested a review from lunika March 11, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants