transfem-org / Sharkey

🌎 A Sharkish microblogging platform 🚀
https://joinsharkey.org/
74 stars 19 forks source link

bug: unhelpful error when submitting an invalid emoji name #163

Closed MoshiBar closed 9 months ago

MoshiBar commented 9 months ago

💡 Summary

when creating an emoji, or editing an existing emoji, if a name with an invalid character is used, an unhelpful error is shown image

🥰 Expected Behavior

message should be helpful, maybe give an error message saying which characters are unable to be used

🤬 Actual Behavior

an unhelpful error message is shown, as described above

📝 Steps to Reproduce

  1. create an emoji or edit an existing emoji, and give it an invalid name: e.g. using a period or hyphen
  2. hit the update button, the error message should show

💻 Frontend Environment

🛰 Backend Environment (for server admin)

Mar0xy commented 9 months ago

This is an error that gets returned by the router and not the software as the add endpoint uses a pattern check for numbers and normal characters (including underscores) provided to the router to check if the request parameter is valid if it has an invalid character it will throw an invalid parameter error which triggers this error.

tl:dr

This is intended and not a bug and no it won't be changed as it exactly explains what happened