gristlabs_grist-core/test/server/lib
Jarosław Sadziński 1d2cf3de49 (core) Adding backend for 2-way references
Summary:
Adding support for 2-way references in data engine.

- Columns have an `reverseCol` field, which says "this is a reverse of the given column, update me when that one changes".
- At the time of setting `reverseCol`, we ensure that it's symmetrical to make a 2-way reference.
- Elsewhere we just implement syncing in one direction:
  - When `reverseCol` is present, user code is generated with a type like `grist.ReferenceList("Tasks", reverse_of="Assignee")`
  - On updating a ref column, we use `prepare_new_values()` method to generate corresponding updates to any column that's a reverse of it.
  - The `prepare_new_values()` approach is extended to support this.
  - We don't add (or remove) any mappings between rows, and rely on existing mappings (in a ref column's `_relation`) to create reverse updates.

NOTE This is polished version of https://phab.getgrist.com/D4307 with tests and 3 bug fixes
- Column transformation didn't work when transforming RefList to Ref, the reverse column became out of sync
- Tables with reverse columns couldn't be removed
- Setting json arrays to RefList didn't work if arrays contained other things besides ints
Those fixes are covered by new tests.

Test Plan: New tests

Reviewers: georgegevoian, paulfitz, dsagal

Reviewed By: georgegevoian, paulfitz

Subscribers: dsagal

Differential Revision: https://phab.getgrist.com/D4322
2024-09-11 22:31:36 +02:00
..
helpers Add tests for UsersManager (#1149) 2024-09-05 16:30:04 -04:00
ACLFormula.ts (core) Support user variable in dropdown conditions 2024-06-04 06:56:55 -07:00
ACLRulesReader.ts (core) Fix null references in form fields bug 2024-04-12 15:46:21 -07:00
Assistance.ts (core) Add AI Assistant retry with shorter prompt 2024-02-12 11:06:52 -05:00
Authorizer.ts Extracts config.json into its own module (#1061) 2024-07-08 15:40:45 +01:00
config.ts config: remove all async/await around config read functions 2024-07-18 14:32:46 -04:00
configCore.ts config: remove all async/await around config read functions 2024-07-18 14:32:46 -04:00
configCoreFileFormats.ts config: remove all async/await around config read functions 2024-07-18 14:32:46 -04:00
DocApi2.ts (core) Adding UI for timing API 2024-05-22 14:56:53 +02:00
DocApi.ts (core) Adding backend for 2-way references 2024-09-11 22:31:36 +02:00
GranularAccess.ts Add tests for UsersManager (#1149) 2024-09-05 16:30:04 -04:00
GristSockets.ts (core) Fix unhandledRejection caused by exception from verifyClient. 2024-08-15 17:32:44 -04:00
HostedStorageManager.ts Remove GRIST_SKIP_REDIS_CHECKSUM_MISMATCH (#1098) 2024-07-10 14:28:20 -04:00
ManyFetches.ts Fix ManyFetches test so it checks TEST_REDIS_URL is set 2024-04-29 14:54:36 -04:00
MemoryPool.ts (core) Manage memory used for websocket responses to reduce the risk of server crashes. 2023-08-07 11:28:31 -04:00
MinIOExternalStorage.ts Shutdown Doc worker when it is not considered as available in Redis #831 (#856) 2024-04-04 10:25:42 -04:00
OIDCConfig.ts OIDC: allow configuring the request timeout (#1177) 2024-09-03 17:10:18 -04:00
ProxyAgent.ts (core) Add logging of errors whenever ProxyAgent is used, and a test for it. 2023-05-17 10:21:53 -04:00
Telemetry.ts (core) Admin Panel and InstallAdmin class to identify installation admins. 2024-03-25 12:18:38 -04:00
UnhandledErrors.ts set TEST_CLEAN_DATABASE when running server tests (#806) 2023-12-27 09:56:59 -05:00
Webhooks-Proxy.ts (core) Adding UI for timing API 2024-05-22 14:56:53 +02:00