From 578aa9d5ca2994ba0b2fdbc93bfa62dbc422f04c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Wed, 3 Dec 2025 15:56:31 +0100 Subject: [PATCH] Fix view disappearing when switching from WORKSPACE to UNLISTED visibility (#16289) ## Description When switching a view's visibility from WORKSPACE to UNLISTED, the code in `view-v2.service.ts` correctly sets `createdByUserWorkspaceId` to the current user (to prevent the view from disappearing). However, this property was not included in `FLAT_VIEW_EDITABLE_PROPERTIES`, which meant: 1. The comparison logic didn't detect the change 2. No update action was created for the property 3. The value was never persisted to the database 4. The view disappeared because it became UNLISTED with no owner This fix adds `createdByUserWorkspaceId` to the editable properties so the change is properly detected and persisted. Might fix https://github.com/twentyhq/twenty/issues/15955 --- ...-entity-properties-to-compare-and-stringify.constant.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-flat-entity-properties-to-compare-and-stringify.constant.ts b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-flat-entity-properties-to-compare-and-stringify.constant.ts index 57da03c534..08a84438cf 100644 --- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-flat-entity-properties-to-compare-and-stringify.constant.ts +++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-flat-entity-properties-to-compare-and-stringify.constant.ts @@ -40,7 +40,12 @@ export const ALL_FLAT_ENTITY_PROPERTIES_TO_COMPARE_AND_STRINGIFY = { propertiesToStringify: ['standardOverrides'], }, view: { - propertiesToCompare: ['key', 'deletedAt', ...FLAT_VIEW_EDITABLE_PROPERTIES], + propertiesToCompare: [ + 'key', + 'deletedAt', + 'createdByUserWorkspaceId', + ...FLAT_VIEW_EDITABLE_PROPERTIES, + ], propertiesToStringify: [], }, viewField: {