You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(replace URL and xc-token with actual values, of course)
Although the request is answered with a HTTP 200 (with the value 1 in the response body), it has not the intended effect, i.e. it does not enable the "Show NULL & Empty in Filters" base setting.
Instead, the next time the NocoDB UI is reloaded, the following error message is displayed, indicating that something went wrong:
JSON.parse: unexpected character at line 1 column 2 of the JSON data
Desired Behavior
The base settings should be configured according to the meta data in the HTTP request.
Further observations related to this issue, i.e. how peculiarly NocoDB handles a base's meta field:
A call to the PATCH /api/v2/meta/bases/{base_id} API endpoint to update a base incl. the meta field succeeds (meaning the result is properly parsed by the server) iff
meta is specified as a character scalar instead of an actual JSON object, and
The POST /api/v2/meta/bases API endpoint to create a new base OTOH accepts meta as a regular JSON object and the result is properly interpreted by the server AFAICT.
After creating a new base this way, the GET /api/v2/meta/bases/{base_id} API endpoint to retrieve an existing base returns the meta field as a JSON object (like the rest of the JSON body).
This is what one would expect.
When config encoded in the meta field is changed via the NocoDB UI, NocoDB seems to store the updated meta config as a character scalar instead of a JSON object. This can be verified by first creating a new base as outlined above, then changing e.g. the base's icon color and finally calling the GET /api/v2/meta/bases/{base_id} endpoint – the meta field in the response body is now a character scalar (containing valid JSON syntax) instead of an actual JSON object.
On page reload, NocoDB seems to attempt to parse a base's meta field (and throws a JSON.parse error if that fails for some reason).
Why is handling the meta field implemented in this way (writing and parsing JSON text instead of directly using actual JSON)? Besides making it hard to use NocoDB's RESTful API, this also unnecessarily complicates development, I think.
Please confirm if bug report does NOT exist already ?
Steps to reproduce ?
Issue the following HTTP request to update a base with the provided
meta
data:(replace URL and
xc-token
with actual values, of course)Although the request is answered with a HTTP 200 (with the value
1
in the response body), it has not the intended effect, i.e. it does not enable the "Show NULL & Empty in Filters" base setting.Instead, the next time the NocoDB UI is reloaded, the following error message is displayed, indicating that something went wrong:
Desired Behavior
The base settings should be configured according to the
meta
data in the HTTP request.Project Details
Node: v20.11.1
Arch: x64
Platform: linux
Docker: false
RootDB: sqlite3
PackageVersion: 0.207.0
Attachments
No response
The text was updated successfully, but these errors were encountered: