parse-community / parse-dashboard

A dashboard for managing Parse Server
https://parseplatform.org
Other
3.74k stars 1.38k forks source link

Add unicode support for `appName` parameter #2432

Open beiguancyc opened 1 year ago

beiguancyc commented 1 year ago

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
parse-github-assistant[bot] commented 1 year ago

Thanks for opening this issue!

mtrezza commented 1 year ago

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

beiguancyc commented 1 year ago

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" } ] }


3. open cmd, parse-dashboard --config C:\config\parse-dashboard-config.json
4. then visit http://127.0.0.1:4040/
5. so,The 404 page will keep appearing as long as you continue to use it.
6. If I switch to parse-dashboard 4.x, everything works fine.
mtrezza commented 1 year ago

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?

beiguancyc commented 1 year ago

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"
    }
  ]
}
mtrezza commented 1 year ago

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

beiguancyc commented 1 year ago

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.

mtrezza commented 1 year ago

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.

beiguancyc commented 1 year ago

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.

mtrezza commented 1 year ago

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.

beiguancyc commented 1 year ago

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": "南".

mtrezza commented 1 year ago

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?

beiguancyc commented 1 year ago

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.

mtrezza commented 1 year ago

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.

xiangdong9013 commented 1 year ago

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