Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] parenthesis inside the foundLocation and hint fields causes data to be truncated #204

Closed
KenEucker opened this issue Nov 25, 2023 · 1 comment · Fixed by #205
Closed
Labels

Comments

@KenEucker
Copy link
Owner

KenEucker commented Nov 25, 2023

Describe the bug
When adding locations or hints that contain the values ( or ), in any combination, have the potential to break how data is stored for these fields.

To Reproduce
Steps to reproduce the behavior:

  1. Submit a foundLocation with a ( or pair (...)
  2. Submit a hint with a ( or pair (...)
  3. Observe the data lost within the hint and foundLocation fields

Expected behavior
For these characters to not break the fields when included.

Screenshots
IMG_3918
Screenshot 2023-11-24 at 8 32 40 PM

Additional context
I think it would be possible to improve the regular expressions that the biketag-api uses to be able to support parenthesis within the hint/foundLocation. If someone wants to help with this, you can look at the regular expressions that take this information and put it into/pull it from the singular title or description fields.

export const getHintFromTextRegex = new RegExp(/(?:hint:\s*?)([^)]*)/i)

Used here:

hint = getHintFromText(mysteryImageDescription)

And here is where the found description is built (using the foundLocation field):

export const getImgurFoundDescriptionFromBikeTagData = (

And here is where the mystery description is built (using the hint field):
https://github.com/KenEucker/biketag-api/blob/0053c3aea51dee8c3d79a9e557323d595fcaa449/src/common/getters.ts#L485C14-L485C55

@KenEucker
Copy link
Owner Author

🎉 This issue has been resolved in version 3.1.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant