Files
twenty/packages/twenty-front
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
..
2024-03-31 10:53:37 +02:00
2024-10-05 00:23:23 +02:00
2023-12-10 18:10:54 +01:00
2024-07-29 13:03:09 +02:00
2024-10-05 00:23:23 +02:00
2024-10-05 00:23:23 +02:00
2024-08-09 08:38:01 +02:00

Run yarn dev while server running on port 3000