OpenSlides / OpenSlides/openslides-backend
Manually creating projectors causes database consistency check to fail
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9
- Forks
- 40
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 19
Description
Describe the bug
Manually creating a projector in the client, without setting is_internal will cause the check_database_all presenter to return a broken verdict. This happens because the client sends null as the value of one field and the backend doesn't stop this.
How To Reproduce
Payload from client (handle_request)
First
[{"action":"projector.create","data":[{"meeting_id":2,"name":"pro jek tor","is_internal":null}]}]
then
[{"presenter":"check_database_all","data":{}}]
Response from backend
For first request
{"status_code": 200, "success": true, "message": "Actions handled successfully", "results": [[{"id": 5, "sequential_number": 3}]]}
For database check
[{"ok": false, "errors": "\tprojector/5: Missing fields is_internal"}]
Expected behavior
The projector.create action should not allow None as a field value for is_internal
Ergo:
- ensure the backend-action does not allow
Nonefor theis_internalfield. - write a migration to fix any old inconsistencies caused by this
It should also be ensured that projector.update doesn't have the same problem
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Reproduce the issue with the shown handle_request payloads, then trace the projector.create and projector.update actions and the check_database_all presenter. Confirm where null is accepted and identify the migration path mentioned in the issue; done means null is rejected for is_internal, existing inconsistencies are repaired, and the database check no longer reports the projector as broken.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100