REST API: Collection settings corrupted when data source updated

Hi,

Build: nocobase/nocobase:2.0.0-beta.13-full

since there is no built-in token refresh mechanism, I manually update the REST API data source with an “Authorization” header that contains the necessary token. However, updating the Data source corrupts the Collection I have created. The Collection name, the List and Get settings (only ones set), and the Record unique key are all lost. The Fields section is still OK.

I tested a bit more and it seems that adding or updating a header in the data source causes the problem.

As a workaround I just fill in the data again.

Cheers,
Kevin

Hello, I couldn’t reproduce your problem. Do you have the steps to reproduce it?

  1. Spin up the Nocobase image using Docker compose
  2. Configure a REST API data source.
  3. Add two or more parameters to the data source and save.
  4. Create a Collection in the data source, minimum config needed.
  5. Edit the data source and change or add a parameter, then save.
  6. Go to Collections view to see the corrupt Collection

Thank you for providing the steps, but I haven’t been able to reproduce the problem. If it doesn’t prevent you from using it, I suggest you ignore it for now.

This is actually a bit of a showstopper. I’ve now verified on AWS with version v2.0.0-beta.15 as follows:

  1. Deploy AWS ECS Fargate service using image tag nocobase/nocobase:beta-full
  2. Install Nocobase license and enable REST API plugin
  3. Configure a REST API data source with one parameter (e.g. “Authorization: 123”)
  4. Create a Collection in the data source with minimum config.
  5. Run Debug to get fields and set record unique key.
  6. Edit the data source and change the parameter value and save.
  7. Go to Collections view to see the corrupt Collection

The Collection name, the List and Get settings (only ones set), and the Record unique key are all lost. The Fields section is still OK.

Any help appreciated.

Cheers,
Kevin

I found a workaround using the Variables feature to set values in the data source. Updating a variable does not corrupt the Collection.

Is it possible to inject variables or change variable values using an API or Yarn?

Cheers,
Kevin