Skip to content

Experiment update fails when app context contains uppercase letters #3152

@zackcl

Description

@zackcl

Version where bug was found:
6.5.0

Describe the bug
When an app context includes uppercase letters, updating an experiment fails with a 400 Bad Request error.

It appears that the system converts the app context to lowercase during the experiment update request, which causes it to no longer match the app context defined in CONTEXT_METADATA.

To Reproduce
Steps to reproduce the behavior:

  1. Add the following to the .env file and start UpGrade:
CONTEXT_METADATA={"ExampleMathApp":{"CONDITIONS":["control","hint_button"],"GROUP_TYPES":[],"EXP_IDS":["problem_123_hint_support"],"EXP_POINTS":["problem_page"]}}
METRICS=[{"metrics":[{"metric":"completionRate","datatype":"categorical","allowedValues":["COMPLETED","NOT_COMPLETED"]},{"metric":"timeOnTask","datatype":"continuous"}],"contexts":["ExampleMathApp"]}]
  1. Create an experiment using the ExampleMathApp app context.
  2. Try to add a decision point to the experiment.
  3. Observe the 400 Bad Request error from PUT /api/experiments/:id:
{
  "name": "BadRequestError",
  "message": "The app context \"examplemathapp\" is not defined in CONTEXT_METADATA."
}

Expected behavior
App contexts with uppercase letters should be supported, or the casing should be handled consistently across CONTEXT_METADATA, METRICS, and experiment update requests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions