twenty icon indicating copy to clipboard operation
twenty copied to clipboard

refactor: apply relation optimistic effects on record update

Open thaisguigon opened this issue 1 year ago • 0 comments

Related to https://github.com/twentyhq/twenty/issues/3509

I had to move useFilteredSearchEntityQuery inside the SingleEntitySelectMenuItemsWithSearch component, because it was triggering findManyRecords queries in the RecordShowPage even when the entity picker dropdown was not open. Those queries were triggered in parallel with the updateOneRecord mutation and were overriding the optimistically updated cache with obsolete data. With this PR, those findManyRecords queries will only be triggered when the entity picker dropdown is opened.

thaisguigon avatar Jan 19 '24 15:01 thaisguigon