Parse-server: Using PostgreSQL10 to install Parse Server, add configuration items, there is an error.

Created on 16 Nov 2018  路  3Comments  路  Source: parse-community/parse-server

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

bug up for grabs

All 3 comments

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

I should have free time this weekend. I鈥檓 still using PG 9.5.

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

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

I should have free time this weekend. I鈥檓 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.

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

https://github.com/parse-community/parse-server/pull/2984 Originally objects were merged (most likely to support dot notation).

https://github.com/parse-community/parse-server/issues/4808 Overrides the object

I was planning on fixing something like this for https://github.com/parse-community/Parse-SDK-JS/issues/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"
            }
        ]
    }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

dcdspace picture dcdspace  路  3Comments

pulse1989 picture pulse1989  路  3Comments

kilabyte picture kilabyte  路  4Comments

omyen picture omyen  路  3Comments

ugo-geronimo picture ugo-geronimo  路  3Comments