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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Dropbox sync fails if script has an emoji (e.g. 馃毀) in title #2082

Open
huyz opened this issue Apr 24, 2024 · 1 comment
Open

[BUG] Dropbox sync fails if script has an emoji (e.g. 馃毀) in title #2082

huyz opened this issue Apr 24, 2024 · 1 comment
Labels

Comments

@huyz
Copy link

huyz commented Apr 24, 2024

Sequence of actions:

  1. Rename a script and add the emoji 馃毀 to it
  2. Sync via Dropbox

Problem:

Settings page says Sync failed!

Background page console says:

index.js:1 Upload script: greasyfork.org-0aGoogle-20Calendar-20-2d-20Dark-20Night-20Mode-20Theme-20-2d-20first-20login-20馃毀-0a
index.js:1 
 POST https://content.dropboxapi.com/2/files/upload 409 (Conflict)
index.js:1 Failed syncing: Dropbox

{error_summary: 'path/malformed_path/.', error: {鈥}
409
"https://content.dropboxapi.com/2/files/upload"

Expected result:

When I rename the script and remove the emoji, the sync succeeds and the Background page console says:

Upload script: greasyfork.org-0aGoogle-20Calendar-20-2d-20Dark-20Night-20Mode-20Theme-20-2d-20first-20login.-20[WIP]-0a

with no error message

Environment:

@huyz huyz added the bug label Apr 24, 2024
@tophf
Copy link
Member

tophf commented Apr 24, 2024

@gera2ld, the fix is arguably to add u to escRE flags in

const escRE = /[\u007f-\uffff]/g; // eslint-disable-line no-control-regex

Although maybe not, because it preserves the emoji, so maybe we should process the surrogate pairs manually?

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

No branches or pull requests

2 participants