PATCH on a multivariate option returns 500 (KeyError: 'feature')
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
The report identifies features/multivariate/serializers.py, line 85, where validate() raises KeyError: 'feature' during a partial update. Read that serializer and its nearby tests, then run the relevant multivariate option API tests. Done when a PATCH with only string_value no longer returns 500, or returns a clear 400 if PATCH is unsupported.
Written by the indexing model from the issue text.
Description
Version: self-hosted 2.295.2 (flagsmith/flagsmith:2.295.2, Docker Compose)
What happens
A partial update of a multivariate option returns HTTP 500 unless the body repeats every field:
curl -i -X PATCH -H "Authorization: Api-Key $ORG_API_KEY" -H "Content-Type: application/json" \
"http://localhost:8000/api/v1/projects/<project>/features/<feature>/mv-options/<option>/" \
-d '{"string_value": "green"}'
Server log
File "/app/features/multivariate/serializers.py", line 85, in validate
KeyError: 'feature'
Expected
The option's value is updated (a 400 would also be fine if PATCH isn't supported), not a 500.
Notes
validate() reads attrs["feature"], which a partial update doesn't include; self.instance.feature could be used instead. Found while building FlagLens, whose seed script works around it.
- Dominant language
- Python
- Stars
- 9.9k
- Forks
- 658
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 168
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Flagsmith/flagsmith
-
Fix Button Alignment in SDK Installation SectionPossibly taken @manueldezman claimed this 3 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Flagsmith/flagsmith#9056 · 2 comments ·
Maintainers usually reply within 1 day
-
Cloud Python warehouse snippet omits the import needed by its short-lived-job guidancePossibly taken @jcd1991 claimed this 4 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Flagsmith/flagsmith#9045 · 1 comment ·
Maintainers usually reply within 1 day
-
Expose whether an organisation is blocked for API usagePossibly taken @PiUnknown claimed this 38 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Flagsmith/flagsmith#8773 · 1 comment ·
Maintainers usually reply within 1 day
-
influx_query_manager doesn't catch ApiException, so Influx error responses 500Possibly taken @SAY-5 claimed this 13 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Flagsmith/flagsmith#8510 · 1 comment ·
Maintainers usually reply within 1 day
-
TypeError: Cannot read properties of undefined (reading 'enabled') in CompareFeatures renderRowPossibly taken @Poison675 claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Flagsmith/flagsmith#8224 · 2 comments ·
Maintainers usually reply within 1 day
All issues in Flagsmith/flagsmith
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 73/100
-
day_or=True union silently becomes the ISC cron AND bug when a day field expands to its full range (e.g. '0 0 */1 * */2' fires only Sun/Tue/Thu/Sat)Possibly taken @rahul05ranjan claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
pallets-eco/croniter#309 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
chore
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
nyjc-computing/campus-admin#105 ·
Maintainers usually reply within 1 day
-
bug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
AOSSIE-Org/Gitcord-GithubDiscordBot#248 · 1 comment ·
Maintainers usually reply within 4 days