shields icon indicating copy to clipboard operation
shields copied to clipboard

This page crashed. URI malformed

Open DJStompZone opened this issue 1 year ago โ€ข 6 comments

Are you experiencing an issue with...

shields.io

๐Ÿž Description

When using the badge maker/tester UI at https://shields.io/badges, the page instantly crashes if the user attempts to input an emoji into the topmost field, showing the message "This page crashed. URI malformed"

๐Ÿ”— Link to the badge

๐Ÿ’ก Possible Solution

Something's presumably choking on extra-long unicode characters such as emojis. Will investigate further

DJStompZone avatar Aug 29 '23 06:08 DJStompZone

I just tried to reproduce this and I am not seeing this issue

Screenshot at 2023-08-29 17-34-16

Are you able to provide any additional info? Whta browser/OS are you using? I'd guess this might be something that only affects a subset of browsers?

chris48s avatar Aug 29 '23 16:08 chris48s

So far I've only reproduced this bug on Microsoft Edge (Version 114.0.1823.36 64-bit) on Xbox One, I can check to see if there's any other browsers that do it as well. I've tested it on Chrome 114 on Android 9 and was unable to reproduce.

DJStompZone avatar Aug 30 '23 19:08 DJStompZone

Update, the crash only occurs when typing in an emoji in the box, if I paste a complete set of params all at once such as ๐Ÿคจ-interesting-blue it works fine and doesn't crash. Upon further inspection, even when I paste in ๐Ÿคจ by itself, it doesn't crash. It only seems to happen using the system UI to enter an emoji though the built-in emoji keyboard. I'm going to have to check to see if this occurs on other Windows environments with similar keyboards such as Windows 10. Will update with any new info.

DJStompZone avatar Aug 30 '23 19:08 DJStompZone

Cool, was able to reproduce on win10 just now, I did not have an issue with regular emoji or win+. emoji It only happend when using the on-screen keyboard, i use it lots for VR. It happends on edge and chrome

edit: confirmed for firefox My intuition tells me its something with docusaurus/its plugins but i can't tell yet, might be related to shields.io implementation as well.

jNullj avatar Sep 06 '23 20:09 jNullj

Was able to confirm it in the demo of https://github.com/cloud-annotations/docusaurus-openapi plugin we use:

  1. go to the demo at https://docusaurus-openapi.netlify.app/cos/create-a-bucket
  2. Insert emoji using the built in on screen win10 keyboard in the first input field on the side menu
  3. Same issue: image I will open an issue on the plugin repo

jNullj avatar Sep 06 '23 20:09 jNullj

I found the bug on docusaurus-openapi, this is the result of onInput for UTF-16 encoded emoji by the keyboard, The current on input solution tries to translate those to URI which fails and results in this error. I will PR a solution today or tomorrow.

jNullj avatar Sep 06 '23 22:09 jNullj

This took longer than I wanted it to, but the fix for this is now deployed

chris48s avatar Mar 23 '24 20:03 chris48s