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

Files and GeoPoints not correctly saved in ParseConfig since Parse Server version 2.2.7 #642

Closed
sidiabale opened this issue Jan 25, 2017 · 17 comments

Comments

@sidiabale
Copy link

From @sidiabale on June 19, 2016 17:0

Issue Description

Files and GeoPoints created in ParseConfig are saved with incorrect types. Types change to String and Array respectively after a refresh.

Steps to reproduce

  1. Open Parse dashboard >> Config >> Create Parameter
  2. Create a parameter of type "File" having any name and select an arbitrary image
  3. Upon creation, parameter shows correct type and image can be opened
  4. Upon refreshing the page, the data type changes to string and image can no longer be opened!

For GeoPoint, select type "GeoPoint" in step 2 and enter any valid latitude and longitude. In step 4, type changes to array after refreshing.

Expected Results

Sample result from parse.com or Parse Server version 2.2.6

 {
    "params": {
      "backgroundImage": {
        "__type": "File",
        "name": "tfss-0086e03d-660f-4a53-bee1-6dfb0e1d6906-Tulips.jpg",
        "url": "http://files.parsetfss.com/9499f1cb-d3b8-4514-aa10-05659741bacc/tfss-0086e03d-660f-4a53-bee1-6dfb0e1d6906-Tulips.jpg"
      },
      "eventLocation": {
        "__type": "GeoPoint",
        "latitude": 37.79215,
        "longitude": -122.390335
      }
    }
}

Actual Outcome

{
    "params": {
      "backgroundImage": "ca58066b323f840fbad7e27c88976d9d_tfss-0086e03d-660f-4a53-bee1-6dfb0e1d6906-Tulips.jpg",
      "eventLocation": [
        "-122.390335",
        "37.79215"
      ]
    }
}

Environment Setup

  • Server
    • parse-server version: 2.2.7 <= version <= 2.2.13 (last worked normally in 2.2.6
    • Operating System: ?
    • Hardware: ?
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Reproduced on openshift and back4apps
  • Database
    • MongoDB version: Tested with 3.2.4 and 3.2.6
    • Storage engine: ?
    • Hardware: ?
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): MongoDB@localhost

Logs/Trace

You can turn on additional logging by configuring VERBOSE=1 in your environment.

Not available

Copied from original issue: parse-community/parse-server#2103

@sidiabale
Copy link
Author

From @jeleed on July 20, 2016 1:5

Seconded. Having the exact same issue using Server v. 2.2.16 and Dashboard v. 1.0.14.

@sidiabale
Copy link
Author

From @vanityx69 on July 20, 2016 13:33

Thirded, same versions of both Server and Dashboard.

@sidiabale
Copy link
Author

From @flovilmart on July 20, 2016 13:41

Can you provide the logs when running with VERBOSE=1 on parse-server ?

@sidiabale
Copy link
Author

From @jeleed on July 20, 2016 23:3

I have attempted to activate logging in the past but have been so far unsuccessful; whenever I attempt to use verbose = 1 the server crashes and no logs are created. It's quite probable that I am still doing it wrong, despite having read and tried every bit of advice from every available thread about it. Also, I'm also not sure exactly in what folder the logs are stored, .

Could you point me to clear and explicit instructions on how to activate logs when using parse via express?

@sidiabale
Copy link
Author

From @jeleed on July 26, 2016 0:59

Update for anyone interested:

This definitely appears to be a bug with the dashboard. When saving a file it is saved in the _GlobalConfig table as a straight-up text value:

"testfile": "15601629111b645b72af4e6e987fbac5_fileGlobalThemeJson.json"

Compare this to the correct value as it is stored in the official Parse site:

"testfile": { "__type": "File", "name": "15601629111b645b72af4e6e987fbac5_fileGlobalThemeJson.json", "url": "http://files.mydomain.com/bae9a4c2-ad5c-4eb6-8a02-4ca46d5b56f0/15601629111b645b72af4e6e987fbac5_fileGlobalThemeJson.json" }

The above came over to my parse database via the migration utility. I have also confirmed that the above value is being properly sent from /lib/Routers/GlobaConfigRouter.js but my trail went cold when I got caught up in a tangle of nested calls not helped by my utter ignorance of nodejs.

As a workaround for now I enter the file via the dashboard, then manually modify its newly created record directly in the database with the proper information. I only have a few files so no big deal but hopefully this issue gets addressed eventually.

@sidiabale
Copy link
Author

From @hramos on September 6, 2016 21:2

@jeleed is there anything we need to fix in Parse Server, or is this something we need to address in the Dashboard?

@sidiabale
Copy link
Author

From @jeleed on September 6, 2016 21:54

@hramos to the best of my knowledge this is strictly an issue with the dashboard. Once the file information is stored correctly in the database (currently via a manual process) everything operates as it should.

The problem is with the dashboard saving file type config parameters as text instead of files. See previous post for details.

@sidiabale
Copy link
Author

From @flovilmart on September 6, 2016 22:2

Can you post the request from the dashboard being made (snapshot of the chrome inspector)

@sidiabale
Copy link
Author

@hramos I'm still facing this problem though you closed the issue without explanation. What is the status?

@sidiabale
Copy link
Author

From @hramos on January 3, 2017 22:44

@sidiabale I closed the issue after 2.5 months of no activity. See above, where @flovilmart asked for more details back on September 6.

@sidiabale
Copy link
Author

@hramos You're right, the issue fell off my radar but I'm now available. Can you please reopen it?
@flovilmart Can you clarify what exactly you want?

@sidiabale
Copy link
Author

@flovilmart What information do you need from me to further debug this issue?

@sidiabale
Copy link
Author

From @flovilmart on January 22, 2017 14:31

Probably some screenshots of the chrome inspector requests responses as it seems to be a dashboard issue. Also can you open it on the dashboard repository instead?

@sidiabale
Copy link
Author

@flovilmart Here are the screenshots (1) before uploading (2) after uploading but before refreshing - correct file type (3) File --> string after refreshing
2103-1

2103-2

2103-3

@aontas
Copy link
Contributor

aontas commented Feb 3, 2017

This is not a problem with the dashboard but a problem with the server. The dashboard is simply displaying the data that it receives (if you want confirmation, check the data that is sent vs received when you make a request to the config). The issue arises because there is no schema or type data stored with the values in mongo.

Sent:
{"params":{"testFile":{"__type":"File","name":"be750fb4376eafe4dc92ff1c45416183_1935726_130584809938_4167770_n.jpg","url":"blah"}},"_method":"PUT","_ApplicationId":"blah","_ClientVersion":"js1.6.14","_MasterKey":"blah","_InstallationId":"blah"}
Received:
{"params":{"testFile":"be750fb4376eafe4dc92ff1c45416183_1935726_130584809938_4167770_n.jpg"}}

parse-community/parse-server#3458 attempts to fix this, but forgets about geopoints (currently).

As mentioned in parse-community/parse-server#2103, this was working in 2.2.6. The type data is stored in the mongo _GlobalConfig collection, but in 2.2.7, it transforms all data to "mongo data", which loses type information (as it is assumed that there is a schema).

I repeat, this is not a dashboard issue, but one of the parse-server.

@aontas
Copy link
Contributor

aontas commented Feb 19, 2017

@flovilmart has fixed this in the parse-server with PR parse-community/parse-server#3531

@flovilmart
Copy link
Contributor

yes update your parse-server, make sure everything is fine in your staging environments!

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

No branches or pull requests

3 participants