twenty/packages/twenty-server
Charles Bochet 7b96be6f8c
Fix optimistic effect deletedAt (#7606)
In this PR, I'm fixing part of the impact of soft deletion on optimistic
rendering.

## Backend Vision

1) Backend endpoints will not return soft deleted records (having
deletedAt set) by default. To get the softDeleted records, we will pass
a { withSoftDelete: true } additional param in the query.
2) Record relations will NEVER contain softDeleted relations

## Backend current state

Right now, we have the following behavior:
- if the query filters do not mention deletedAt, we don't return
softDeletedRecords
- if the query filters mention deletedAt, we take it into consideration.
Meaning that if we want to have the softDeleted records in any way we
need to do { or: [ deletedAt: NULL, deletedAt: NOT_NULL] }

## Optimistic rendering strategy

1) useDestroyOne/Many is triggering destroyOptimisticEffects (previously
deleteOptimisticEffects)
2) UseDeleteOne/Many and useRestoreOne/Many are actually triggering
updateOptimisticEffects (as they only update deletedAt field) AND we
need updateOptimisticEffects to take into account deletedAt (future
withSoftDelete: true) filter.
2024-10-11 20:23:01 +02:00
..
@types feat: add integration tests (#6923) 2024-09-20 11:02:52 +02:00
patches Improve demo seed (#7125) 2024-09-18 17:35:08 +02:00
scripts feat: add integration tests (#6923) 2024-09-20 11:02:52 +02:00
src Fix optimistic effect deletedAt (#7606) 2024-10-11 20:23:01 +02:00
test Fix all broken CIs (#7439) 2024-10-05 00:23:23 +02:00
.env.example fix(6423): add username and password for redis connection (#6745) 2024-09-04 16:56:37 +02:00
.env.test feat: add integration tests (#6923) 2024-09-20 11:02:52 +02:00
.eslintrc.cjs feat: add integration tests (#6923) 2024-09-20 11:02:52 +02:00
.gitignore feat: add integration tests (#6923) 2024-09-20 11:02:52 +02:00
.prettierignore Migrate to a monorepo structure (#2909) 2023-12-10 18:10:54 +01:00
.prettierrc Migrate to a monorepo structure (#2909) 2023-12-10 18:10:54 +01:00
.swcrc feat: twenty orm for standard and custom objects (#6178) 2024-07-19 18:23:52 +02:00
jest-integration.config.ts feat: add integration tests (#6923) 2024-09-20 11:02:52 +02:00
jest.config.ts Fix all broken CIs (#7439) 2024-10-05 00:23:23 +02:00
nest-cli.json 6653 serverless functions store and use environment variables in serverless function scripts (#7390) 2024-10-03 13:56:17 +02:00
package.json Bump version to v0.31.0 (#7500) 2024-10-08 17:22:16 +02:00
project.json Fix worker run ci step (#7437) 2024-10-04 19:28:29 +02:00
tsconfig.build.json chore: set up twenty-emails config so build isn't needed in development (#3619) 2024-01-29 06:17:12 -03:00
tsconfig.json feat: add integration tests (#6923) 2024-09-20 11:02:52 +02:00
tsconfig.scripts.json feat: add integration tests (#6923) 2024-09-20 11:02:52 +02:00