Flagsmith / Flagsmith/flagsmith

Partially updating a multivariate option returns 500

Open
#8,306 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
6.6k
Forks
567
Avg merge
1d 13h
Merged PRs (30d)
121

Description

`PATCH /api/v1/projects/{project}/features/{feature}/mv-options/{id}/` returns a 500 when the payload leaves out `default_percentage_allocation`, which prevents updates to change only a variant key.

## Steps To Reproduce

1. Create a multivariate feature with at least one variant.
2. `PATCH .../mv-options/{id}/` with `{"feature": , "key": "hero"}`.
3. The response is 500.

## Expected behaviour

A partial update succeeds, leaving the allocation as it is.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the PATCH request against /api/v1/projects/{project}/features/{feature}/mv-options/{id}/ with the feature and key fields only, then trace the API serializer and update path handling default_percentage_allocation. Done means the partial update returns successfully, preserves the existing allocation, and has coverage for the reported request.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.