nextcloud / tables

🍱 Nextcloud tables app
https://apps.nextcloud.com/apps/tables
GNU Affero General Public License v3.0
143 stars 24 forks source link

API view is returning only partial dataset in JSON, some column are missing. #1008

Open Sylvain303 opened 5 months ago

Sylvain303 commented 5 months ago

Steps to reproduce

  1. Create table, add some columns, example: fristname, lastname, email
  2. also add a column as choice with a default value checked, example: status: [new, in_progress, error]
  3. add some rows (without filling choice column letting default value)
  4. add one row with choice column value forced (may be default value)
  5. Create a view on a the table
  6. add some metdata column like ID or createdBy
  7. This is correctly displayed in the web browser (including filled default values)
  8. call API /index.php/apps/tables/api/1/views/{viewId}/rows ==> only partial data are displayed in JSON

all data shown are fake randomly generated

My view image

form the table image

Expected behavior

All data, including default value, if any, should be send as JSON result. This actually work in the View export as CSV were all data are pushed to the CSV (except unfilled default value left as blank)

Here API call is not consistent, with the data visually available on the browser.

Actual behavior

Partial data set is returned

calling API /index.php/apps/tables/api/1/views/{viewId}/rows

[
  "troncated_data[...]" : "I  didn't paste all data",
  {
    "id": 2031,
    "tableId": 4,
    "createdBy": "admin",
    "createdAt": "2024-04-26 12:56:13",
    "lastEditBy": "admin",
    "lastEditAt": "2024-04-26 12:56:13",
    "data": [
      {
        "columnId": 25,
        "value": "igor@email.invalid"
      },
      {
        "columnId": 24,
        "value": "Dosgor"
      },
      {
        "columnId": 23,
        "value": "Igor"
      }
    ]
  },
  {
    "id": 2032,
    "tableId": 4,
    "createdBy": "admin",
    "createdAt": "2024-04-26 13:00:21",
    "lastEditBy": "admin",
    "lastEditAt": "2024-04-26 13:00:21",
    "data": [
      {
        "columnId": 25,
        "value": "ivanoe@terrible.email"
      },
      {
        "columnId": 24,
        "value": "Leterrible"
      },
      {
        "columnId": 23,
        "value": "Ivan"
      }
    ]
  }
]

Tables app version

0.7.0

Browser

125.0 (64-bit)

Client operating system

xubuntu 22.04

Operating system

Linux debian 12 (64 bits)

Web server

None

PHP engine version

PHP 8.2

Database

PostgreSQL

Additional info

No response