parse-server: Files and GeoPoints not correctly saved in ParseConfig since Parse Server version 2.2.7
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
- Open Parse dashboard >> Config >> Create Parameter
- Create a parameter of type “File” having any name and select an arbitrary image
- Upon creation, parameter shows correct type and image can be opened
- 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
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 3
- Comments: 15 (5 by maintainers)
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.