element-hq / element-hq/synapse

Accepts "1" for a boolean

Open
#10,497 0 comments 0 reactions 0 assignees View on GitHub
A-Spec-Compliance T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#10497](https://github.com/matrix-org/synapse/issues/10497).

---

When the matrix specification says a type is a boolean, synapse accepts both `0`, `1`, `false` and `true` in the request, while only `false` and `true` are valid values.

I've seen this behaviour in at least the typing API (https://github.com/matrix-org/sytest/pull/1088) and the register API (https://github.com/matrix-org/sytest/pull/1089)

Contributor guide

Open the contributing guide

Research direction

Start with the typing API and register API request handling, then compare their boolean validation with the Matrix specification. Review the related sytest coverage referenced in PRs #1088 and #1089. Done means invalid numeric boolean values are rejected while the specified boolean values remain accepted in both APIs.

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
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.