twenty
twenty copied to clipboard
refactor: apply relation optimistic effects on record update
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.