Added record filter hidden fields in query (#18149)

Fixes https://github.com/twentyhq/twenty/issues/17506

Hidden fields are now queried when they are in record filters, to avoid
optimistic and filtering bugs with hidden fields.
This commit is contained in:
Lucas Bordeau
2026-03-06 17:33:09 +01:00
committed by GitHub
parent 02bd71052b
commit 73268535dc
12 changed files with 138 additions and 27 deletions
@@ -0,0 +1,77 @@
import { filterDuplicatesById } from '@/utils/array/filterDuplicatesById';
type ObjectRecordTest = { id: string };
describe('filterDuplicatesById', () => {
it('should work with empty array', () => {
const array: ObjectRecordTest[] = [];
const filteredArray = array.filter(filterDuplicatesById);
expect(filteredArray).toEqual([]);
});
it('should work with no duplicates', () => {
const array: ObjectRecordTest[] = [
{
id: '1',
},
{
id: '2',
},
];
const filteredArray = array.filter(filterDuplicatesById);
expect(filteredArray).toEqual(array);
});
it('should work with one duplicate', () => {
const array: ObjectRecordTest[] = [
{
id: '1',
},
{
id: '1',
},
];
const filteredArray = array.filter(filterDuplicatesById);
expect(filteredArray).toEqual([{ id: '1' }]);
});
it('should work with multiple duplicates', () => {
const array: ObjectRecordTest[] = [
{
id: '1',
},
{
id: '1',
},
{
id: '2',
},
{
id: '3',
},
{
id: '3',
},
];
const filteredArray = array.filter(filterDuplicatesById);
expect(filteredArray).toEqual([
{
id: '1',
},
{
id: '2',
},
{
id: '3',
},
]);
});
});