{"record":{"id":"a4bf973ca01145b8","repo":"instructure/canvas-lms","slug":"cannot-create-non-collaborative-groups-when-the","errorCode":null,"errorMessage":"cannot create non-collaborative groups when the differentiation tags feature flag is disabled","messagePattern":"cannot create non-collaborative groups when the differentiation tags feature flag is disabled","errorType":"exception","errorClass":"GraphQL::ExecutionError","httpStatus":null,"severity":"error","filePath":"app/graphql/mutations/create_group_in_set.rb","lineNumber":40,"sourceCode":"  graphql_name \"CreateGroupInSet\"\n\n  argument :group_set_id, ID, required: true, prepare: GraphQLHelpers.relay_or_legacy_id_prepare_func(\"GroupSet\")\n  argument :name, String, required: true\n  argument :non_collaborative, Boolean, required: false, default_value: false\n\n  field :group, Types::GroupType, null: true\n\n  def resolve(input:)\n    category_id = GraphQLHelpers.parse_relay_or_legacy_id(input[:group_set_id], \"GroupSet\")\n    set = GroupCategory.find(category_id)\n    account = (set.context_type == \"Account\") ? set.context : set.context&.account\n    verify_authorized_action!(set.context, :manage_groups_add)\n\n    if input[:non_collaborative]\n      if account&.allow_assign_to_differentiation_tags?\n        raise GraphQL::ExecutionError, \"insufficient permissions to create non-collaborative groups\" unless set.context&.grants_right?(current_user, session, :manage_tags_add)\n      else\n        raise GraphQL::ExecutionError, \"cannot create non-collaborative groups when the differentiation tags feature flag is disabled\"\n      end\n    elsif set.non_collaborative\n      raise GraphQL::ExecutionError, \"cannot create collaborative groups in a non-collaborative group set\"\n    end\n\n    group = set.groups.build(name: input[:name], context: set.context, non_collaborative: input[:non_collaborative])\n\n    if group.save\n      { group: }\n    else\n      errors_for(group)\n    end\n  rescue ActiveRecord::RecordNotFound\n    raise GraphQL::ExecutionError, \"not found\"\n  end\nend\n","sourceCodeStart":22,"sourceCodeEnd":57,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/graphql/mutations/create_group_in_set.rb#L22-L57","documentation":"CreateGroupInSet#resolve raises this ExecutionError when input[:non_collaborative] is true but the owning account does not have allow_assign_to_differentiation_tags? enabled. Non-collaborative (differentiation tag) groups are only creatable while that account-level setting is on.","triggerScenarios":"createGroupInSet with non_collaborative: true against an account where the 'Assign to Differentiation Tags' feature flag / allow_assign_to_differentiation_tags setting is disabled.","commonSituations":"Client built against a staging account with the flag on, deployed against production with it off; flag recently disabled at the account or site-admin level while the UI still offers tag groups; sub-accounts inheriting a parent account's disabled setting.","solutions":["Enable allow_assign_to_differentiation_tags on the account (account settings / feature flag) if tag groups are desired.","Otherwise omit non_collaborative (or pass false) to create a normal collaborative group.","Check the account of the group set's context — the flag is evaluated on set.context.account, possibly a different account than expected.","Gate the UI option on the account's differentiation-tags setting before offering it."],"exampleFix":"// before\ncreateGroupInSet({groupSetId, name, non_collaborative: true})\n\n// after\nif (account.allowAssignToDifferentiationTags) {\n  createGroupInSet({groupSetId, name, non_collaborative: true})\n} else {\n  createGroupInSet({groupSetId, name, non_collaborative: false})\n}","handlingStrategy":"fallback","validationCode":"if (nonCollaborative && !account.allowAssignToDifferentiationTags) {\n  warn('differentiation tags disabled; creating collaborative group instead')\n}","typeGuard":"const tagGroupsEnabled = (account) => account?.allowAssignToDifferentiationTags === true","tryCatchPattern":null,"preventionTips":["Surface account feature-flag state to the client before rendering forms.","Fall back to collaborative groups when the flag is off.","Keep staging/prod flag states in sync or detect divergence at deploy."],"tags":["graphql","feature-flag","groups","differentiation-tags"],"backgroundTag":"feature-not-enabled","analyzedSha":"1c9f0bb8013ed69c4f2efe11fd483025469b7e6c","analyzedAt":"2026-09-15T20:33:18.891Z","contentChangedAt":"2026-09-15T20:33:18.891Z","schemaVersion":2},"datasetVersion":"2026-09-23T02:17:17.105Z"}