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

Incorrectly decoded tag names cause URIError: URI malformed #4125

Closed
sentry-io bot opened this issue Apr 16, 2024 · 0 comments · Fixed by #4144 · May be fixed by #4143
Closed

Incorrectly decoded tag names cause URIError: URI malformed #4125

sentry-io bot opened this issue Apr 16, 2024 · 0 comments · Fixed by #4144 · May be fixed by #4143
Assignees
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟧 priority: high Stalls work on the project or its dependents 🧱 stack: frontend Related to the Nuxt frontend

Comments

@sentry-io
Copy link

sentry-io bot commented Apr 16, 2024

Description

Some tags in the database were encoded incorrectly, and we decode them in the frontend:

const regexes = [
/\\x([\da-f]{2})/gi,
/\\u([\da-f]{4})/gi,
/u([\da-f]{4})/gi,
]
regexes.forEach((regex) => {
data = data.replace(regex, (_, grp) =>
String.fromCharCode(parseInt(grp, 16))
)
})
return decodeURI(data)

Some combinations are incorrect and are converted to combinations that cannot be URI encoded. When we try to use them as part of the tag collection url, we get an unhandled gray screen exception.

For instance, the udadd in ciudaddelassiencias is incorrectly decoded.

Sentry Issue

OPENVERSE-FRONTEND-1VB

URIError: URI malformed
  at encodeURIComponent (<anonymous>)
  at Array.map (<anonymous>)
  at router.resolve (./.nuxt/router.js:12294:12)
  at resolveRoute (./.nuxt/nuxt-i18n/plugin.routing.js:68:39)
  at localePath (./.nuxt/nuxt-i18n/plugin.routing.js:12:39)
...
(45 additional frame(s) were not displayed)
@sentry-io sentry-io bot added 💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟧 priority: high Stalls work on the project or its dependents 🧱 stack: frontend Related to the Nuxt frontend labels Apr 16, 2024
@obulat obulat self-assigned this Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟧 priority: high Stalls work on the project or its dependents 🧱 stack: frontend Related to the Nuxt frontend
Projects
Archived in project
1 participant