parse-dashboard icon indicating copy to clipboard operation
parse-dashboard copied to clipboard

Add unicode support for `appName` parameter

Open beiguancyc opened this issue 1 year ago • 15 comments

New Issue Checklist

Enviroment:

parse-dashboard 5.1.0 / parse-server 5.4.0

Issue Description

Since version 5.0, clicking on the sidebar always results in a 404 error page, and the data only shows up after refreshing again. This issue did not exist in version 4.x.

Based on my testing, starting from version 5.0, it is not possible to use the parse-dashboard-config.json file as a configuration file. Otherwise, a 404 error will occur. image

beiguancyc avatar May 04 '23 16:05 beiguancyc

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

Could you provide step-by-step instructions to replicate this issue, maybe as a screen recording?

mtrezza avatar Jun 05 '23 21:06 mtrezza

Could you provide step-by-step instructions to replicate this issue, maybe as a screen recording?

Sure.

  1. npm install -g parse-dashboard
  2. this is my config file named parse-dashboard-config.json
{

"apps": [ 
	{
      "serverURL": "https://www.aaa.com:7998",
	  "graphQLServerURL": "https://www.aaa.com:7998/graphql",
      "appId": "aaaa",
      "masterKey": "aaaaaa",
      "javascriptKey": "aaaa",
      "appName": "aaa",
	  "production": true,
      "iconName": "logo.png"
    }
	],
  "iconsFolder": "icons",
  "users": [
    {
      "user":"user1",
      "pass":"pass"
    }
  ]
}
  1. open cmd, parse-dashboard --config C:\config\parse-dashboard-config.json
  2. then visit http://127.0.0.1:4040/
  3. so,The 404 page will keep appearing as long as you continue to use it.
  4. If I switch to parse-dashboard 4.x, everything works fine.

beiguancyc avatar Jun 06 '23 01:06 beiguancyc

The only documented breaking change to 5.x is drop of Node 12 support, so the config file should be working. Could you remove parts of the config to see what part is causing this? Or maybe the other way around; start with a plain deployment and gradually add your customizations.

You are installing globally. Could you remove any cached version of Parse Dashboard and not install globally but locally?

mtrezza avatar Jun 06 '23 07:06 mtrezza

I have followed your suggestion and simplified the configuration file to the minimum possible extent. Additionally, I have tested it on two clean virtual machines, but the results remain the same as my previous tests. I would like to know if you are able to reproduce this issue on your end.

{

"apps": [ 
	{
      "serverURL": "https://www.aaa.com:7998",
      "appId": "aaaa",
      "masterKey": "aaaaaa" 
    }
],
  
  "users": [
    {
      "user":"user1",
      "pass":"pass"
    }
  ]
}

beiguancyc avatar Jun 06 '23 09:06 beiguancyc

Could you try to use a fresh, non-customized deployment of Parse Dashboard? If that also fails then we would at least know that it hasn't anything to do with your config, but possibly with your setup

mtrezza avatar Jun 06 '23 14:06 mtrezza

If you run the command parse-dashboard --appId aaaa --masterKey aaaaaa --serverURL "https://www.aaa.com:7998" --appName optionalName without using a configuration file, it works fine. Furthermore, I have validated the results on multiple machines.

beiguancyc avatar Jun 06 '23 15:06 beiguancyc

If you can reproduce the issue locally, you could just clone the Parse Dashboard repository and debug-step through the code to see what leads you to the 404 page.

mtrezza avatar Jun 06 '23 16:06 mtrezza

If you can reproduce the issue locally, you could just clone the Parse Dashboard repository and debug-step through the code to see what leads you to the 404 page.

Can you reproduce this issue on your end? If you cannot reproduce it, then it seems to be an issue specific to me.

beiguancyc avatar Jun 07 '23 01:06 beiguancyc

I was not able to reproduce this, the dashboard config file is a very basic functionality, I would be surprised if it didn't work for any version 5.x; hence I'd suggest to try it out with a fresh, clean clone of the repository and see it it works.

mtrezza avatar Jun 07 '23 10:06 mtrezza

I was not able to reproduce this, the dashboard config file is a very basic functionality, I would be surprised if it didn't work for any version 5.x; hence I'd suggest to try it out with a fresh, clean clone of the repository and see it it works.

I believe I have identified the issue. I found that if the appName contains Chinese characters, it consistently triggers the problem, for example, "appName": "南".

beiguancyc avatar Jun 07 '23 11:06 beiguancyc

Yes, I can imagine that unicode support does not explicitly exist for internal configuration parameters, such as app name. But you said you used the same config file, only changed the dashboard version, so do you mean an app name with Chinese chars worked on 4.x?

mtrezza avatar Jun 07 '23 11:06 mtrezza

Yes, I can imagine that unicode support does not explicitly exist for internal configuration parameters, such as app name. But you said you used the same config file, only changed the dashboard version, so do you mean an app name with Chinese chars worked on 4.x?

Yes, using Chinese characters for appName doesn't cause any issues in version 4.x.

beiguancyc avatar Jun 07 '23 11:06 beiguancyc

I don't think that Parse Server and Parse Dashboard officially support unicode for internal parameters such as appName or appId or any of the client SDK keys such as javascriptKey. My default assumption would be that it doesn't, because there's some string manipulation throughout the code (in Parse Server and Parse Dashboard) that would not work for unicode and I didn't see any test in Parse Server for unicode compatibility.

So I'll classify this as a feature request rather than a bug. Please feel free if you want to investigate this further and add unicode support for the app name in Parse Dashboard. We should also add a note to the docs once support is added.

mtrezza avatar Jun 07 '23 12:06 mtrezza

I got the same issue. My 'appName' contains Chinese characters, too.When change the 'appName' to pure English,it works fine.

xiangdong9013 avatar Aug 25 '23 06:08 xiangdong9013