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

Using PostgreSQL10 to install Parse Server, add configuration items, there is an error. #5176

Closed
dovewi opened this issue Nov 16, 2018 · 3 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@dovewi
Copy link

dovewi commented Nov 16, 2018

Issue Description

When installing Parse Server with PostgreSQL 10, adding Config entries to ParseDashboard will result in deletion of the old Config entries, i.e. Config can only put one entry. After checking the database, it is found that each new Config entry objectId is 1.

Steps to reproduce

Before adding new entries:
before_add_secend_config

then add new one:
add_new_config

add success and refresh page:
after_refresh

the db record:
db_record

Expected Results

There was originally a configuration item,after adding an entry, there should be two configuration items.

Actual Outcome

In fact, only new configuration items are added after the old ones are replaced.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 3.0.0
    • Operating System: unknown , like heroku PaaS platform,sina cloud SAE service
    • Hardware: unknown
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): remote, sina SAE
  • Database

    • PostgreSQL version: 10.0
    • Storage engine: S3
    • Hardware: unknown
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc):remote ,Aliyun RDS

Logs/Trace

@dplewis
Copy link
Member

dplewis commented Nov 16, 2018

Do you want to try a pull request to address this?

I should have free time this weekend. I’m still using PG 9.5.

It might be an issue with how JSON objects are handled in 10

@dovewi
Copy link
Author

dovewi commented Nov 16, 2018

Do you want to try a pull request to address this?

I should have free time this weekend. I’m still using PG 9.5.

It might be an issue with how JSON objects are handled in 10

All right, I'll try it then.

@dplewis dplewis added type:bug Impaired feature or lacking behavior that is likely assumed up-for-grabs labels Nov 20, 2018
@dplewis
Copy link
Member

dplewis commented Nov 20, 2018

@dovewi I tried this on both PG 9.6 and PG 10. And I was able to reproduce what you were getting.

#2984 Originally objects were merged (most likely to support dot notation).

#4808 Overrides the object

I was planning on fixing something like this for parse-community/Parse-SDK-JS#680

{ 'params.file': { __type: 'File', name: 'name', url: 'http://url' } }
{ 'params.newConfig': 'good' }

its basically like config.set('params.file') and config.set('params.newConfig');

@flovilmart What do you think?

This test fails

fit('can add new config to existing config', async () => {
    await request({
      method: 'PUT',
      url: 'http://localhost:8378/1/config',
      json: true,
      body: {
        params: { file: [{ __type: 'File', name: 'name', url: 'http://url' }] },
      },
      headers,
    });

    await request({
      method: 'PUT',
      url: 'http://localhost:8378/1/config',
      json: true,
      body: {
        params: { newConfig: 'good' },
      },
      headers,
    });

    const result = await Parse.Config.get();
    console.log(result.get('file')); // returns undefined should be [{ __type: "File" ...}]
    console.log(result.get('newConfig')); // returns 'good'
  });

Example object

 "params": {
        "newConfig": "good",
        "file": [
            {
                "__type": "File", "name": "name", "url": "http://url"
            }
        ]
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

2 participants