Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving MV features sometimes result in 500 server error #429

Closed
matthewelwell opened this issue Oct 21, 2021 · 0 comments
Closed

Saving MV features sometimes result in 500 server error #429

matthewelwell opened this issue Oct 21, 2021 · 0 comments
Assignees
Labels
bug Something isn't working front-end Issue related to the React Front End Dashboard

Comments

@matthewelwell
Copy link
Contributor

When the FE is updating the multivariate_feature_state_values (MVFSVs) associated with a given feature state, it seems
to be using the ID of the multivariate_feature_option (MVFO), not the ID of the MVFSV. I've included some sample
requests below taken from the network console.

Step 1. User creates a new feature with 3 variations of 20, 30 & 40% weightings respectively

The request for this is irrelevant.

Step 2. User closes and reopens the feature in a given environment

FE makes a GET request to /api/v1/environments/:id/featurestates/:id/ with the following response body:

{
  "id": 71367,
  "feature_state_value": "control",
  "multivariate_feature_state_values": [
    {
      "id": 2704,
      "multivariate_feature_option": 784,
      "percentage_allocation": 40.0
    },
    {
      "id": 2702,
      "multivariate_feature_option": 783,
      "percentage_allocation": 30.0
    },
    {
      "id": 2700,
      "multivariate_feature_option": 782,
      "percentage_allocation": 20.0
    }
  ],
  "enabled": false,
  "feature": 13404,
  "environment": 7477,
  "identity": null,
  "feature_segment": null
}

Note that the ids of the MVFSVs themselves are different to the ids of the MVFOs.

Step 3. User attempts to resave the feature (without changing anything)

The FE makes a PUT request to /api/v1/environments/:id/featurestates/:id/ with the following body:

{
  "id": 71367,
  "feature_state_value": "control",
  "multivariate_feature_state_values": [
    {
      "id": 784,
      "multivariate_feature_option": 784,
      "percentage_allocation": 40
    },
    {
      "id": 783,
      "multivariate_feature_option": 783,
      "percentage_allocation": 30
    },
    {
      "id": 782,
      "multivariate_feature_option": 782,
      "percentage_allocation": 20
    }
  ],
  "identity": null,
  "enabled": false,
  "feature": 13404,
  "environment": 7477,
  "feature_segment": null
}

Note that the ids are now that of the MVFOs not the ids that were returned for the MVFSVs.

@dabeeeenster dabeeeenster added bug Something isn't working front-end Issue related to the React Front End Dashboard labels Oct 21, 2021
@dabeeeenster dabeeeenster added this to the Front End ToDo milestone Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working front-end Issue related to the React Front End Dashboard
Projects
None yet
Development

No branches or pull requests

3 participants