{"record":{"id":"6cb0ffcdea04c917","repo":"instructure/canvas-lms","slug":"stickers-feature-flag-must-be-enabled","errorCode":null,"errorMessage":"Stickers feature flag must be enabled","messagePattern":"Stickers feature flag must be enabled","errorType":"exception","errorClass":"GraphQL::ExecutionError","httpStatus":null,"severity":"error","filePath":"app/graphql/mutations/update_submission_sticker.rb","lineNumber":38,"sourceCode":"class Mutations::UpdateSubmissionSticker < Mutations::BaseMutation\n  argument :anonymous_id, ID, required: true\n  argument :assignment_id, ID, required: true\n  argument :sticker, Types::StickerType, required: false\n\n  field :submission, Types::SubmissionType, null: false\n\n  def resolve(input:)\n    # Ideally we would use required: :nullable above for sticker, but it doesn't seem to work...\n    raise GraphQL::ExecutionError, \"'sticker' is required. Provide a value of null to remove a sticker\" unless input.key?(:sticker)\n\n    submission = Submission.find_by(\n      root_account: context[:domain_root_account],\n      assignment_id: input.fetch(:assignment_id),\n      anonymous_id: input.fetch(:anonymous_id)\n    )\n\n    raise GraphQL::ExecutionError, \"not found\" if submission.nil? || !submission.grants_right?(current_user, :grade)\n    raise GraphQL::ExecutionError, \"Stickers feature flag must be enabled\" unless submission.course.feature_enabled?(:submission_stickers)\n\n    if submission.update(sticker: input.fetch(:sticker))\n      { submission: }\n    else\n      errors_for(submission)\n    end\n  end\nend\n","sourceCodeStart":20,"sourceCodeEnd":47,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/graphql/mutations/update_submission_sticker.rb#L20-L47","documentation":"Guard in Mutations::UpdateSubmissionSticker#resolve: the stickers feature flag is not enabled on the root account, so the GraphQL mutation refuses to run and raises GraphQL::ExecutionError. It is a sentinel error for a feature-gated mutation, not a data problem.","triggerScenarios":"Calling updateSubmissionSticker in a course/account where the submission_stickers feature flag is off (site/account/course level).","commonSituations":"Feature not yet rolled out to the account; testing on a new course without enabling the flag; flag enabled for another course but not this one.","solutions":["Enable the submission_stickers feature flag at site, account, or course level (Feature Flags settings)","Enable it in the Rails console: course.enable_feature!(:submission_stickers) or account.enable_feature!","Hide/disable the sticker UI client-side when the flag is off","Check with an admin if the flag is not visible in your account"],"exampleFix":"// before\nupdateSubmissionSticker(...) // flag off -> error\n// after\nif (course.featureEnabled('submission_stickers')) updateSubmissionSticker(...)","handlingStrategy":"validation","validationCode":"if (!course.featureEnabled?.('submission_stickers')) return; // don't call the mutation","typeGuard":"const stickersEnabled = (c) => c?.featureEnabled?.('submission_stickers') === true","tryCatchPattern":"try { await gql(updateSubmissionStickerMutation, vars) } catch (e) { if (/feature flag/.test(e.message)) hideStickerUI(); else throw e }","preventionTips":["Gate the sticker UI behind the feature flag from course data","Enable submission_stickers in target accounts before rollout","Test with flag on and off"],"tags":["graphql","feature-flag"],"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"}