{"record":{"id":"50d6eafe75ca3671","repo":"twentyhq/twenty","slug":"standard-application-is-missing-the-messagecampaig","errorCode":null,"errorMessage":"Standard application is missing the messageCampaign name field","messagePattern":"Standard application is missing the messageCampaign name field","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/twenty-server/src/database/commands/upgrade-version-command/2-25/2-25-workspace-command-1785229970000-add-message-campaign-name-field.command.ts","lineNumber":114,"sourceCode":"      });\n\n    const fieldsToCreate: FlatFieldMetadata[] = [];\n\n    if (\n      !isDefined(\n        flatFieldMetadataMaps.byUniversalIdentifier[\n          NAME_FIELD_UNIVERSAL_IDENTIFIER\n        ],\n      )\n    ) {\n      const standardNameField =\n        findFlatEntityByUniversalIdentifier<FlatFieldMetadata>({\n          flatEntityMaps: standardAllFlatEntityMaps.flatFieldMetadataMaps,\n          universalIdentifier: NAME_FIELD_UNIVERSAL_IDENTIFIER,\n        });\n\n      if (!isDefined(standardNameField)) {\n        throw new Error(\n          'Standard application is missing the messageCampaign name field',\n        );\n      }\n\n      fieldsToCreate.push(standardNameField);\n    }\n\n    // Move the label identifier from subject to name, but never clobber a\n    // user customization pointing at another field.\n    const currentLabelIdentifier =\n      campaignObjectMetadata.labelIdentifierFieldMetadataUniversalIdentifier;\n    const isNameLabelIdentifier =\n      !isDefined(currentLabelIdentifier) ||\n      currentLabelIdentifier === SUBJECT_FIELD_UNIVERSAL_IDENTIFIER ||\n      currentLabelIdentifier === NAME_FIELD_UNIVERSAL_IDENTIFIER;\n    const flatObjectMetadataToUpdate: FlatObjectMetadata[] =\n      isNameLabelIdentifier &&\n      currentLabelIdentifier !== NAME_FIELD_UNIVERSAL_IDENTIFIER","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-server/src/database/commands/upgrade-version-command/2-25/2-25-workspace-command-1785229970000-add-message-campaign-name-field.command.ts#L96-L132","documentation":"Thrown by the 2.25 command that adds the internal name field to messageCampaign. After confirming the workspace has the messageCampaign object but lacks the name field, the command looks up the standard field definition via findFlatEntityByUniversalIdentifier in the computed standard flat field metadata maps. If STANDARD_OBJECTS.messageCampaign.fields.name is absent from the standard definitions, the lookup returns undefined and the command throws.","triggerScenarios":"Running 'upgrade:2-25:add-message-campaign-name-field' when twenty-shared/metadata does not define STANDARD_OBJECTS.messageCampaign.fields.name.universalIdentifier. Caused by version skew between twenty-server and twenty-shared, or the name field was removed/renamed in a fork.","commonSituations":"Forked twenty-shared where messageCampaign fields were customized; running against an older twenty-shared build that predates the name field; a regression in standard definitions.","solutions":["Verify STANDARD_OBJECTS.messageCampaign.fields.name exists in the installed twenty-shared package","Rebuild twenty-shared: npx nx build twenty-shared","Ensure twenty-server and twenty-shared are at the same release tag","Run with --dryRun first to confirm the standard field resolves"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before running, verify the standard field exists in the installed definitions\nimport { STANDARD_OBJECTS } from 'twenty-shared/metadata';\n\nconst fieldUid = STANDARD_OBJECTS.messageCampaign?.fields?.name?.universalIdentifier;\n\nif (!fieldUid) {\n  throw new Error('twenty-shared does not define messageCampaign.fields.name — rebuild twenty-shared');\n}","typeGuard":"import { isDefined } from 'twenty-shared/utils';\n\nconst hasStandardField = (uid: string | undefined): uid is string =>\n  isDefined(uid) && uid.length > 0;","tryCatchPattern":null,"preventionTips":["Rebuild twenty-shared before running upgrade commands","Run with --dryRun first to confirm the standard field resolves","Keep twenty-server and twenty-shared at the same release version","Add integration tests verifying standard messageCampaign field identifiers"],"tags":["metadata","upgrade-command","standard-application","workspace-migration","flat-field-metadata","message-campaign"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}