Skip to content

Manually creating projectors causes database consistency check to fail #3020

@luisa-beerboom

Description

@luisa-beerboom

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:

  1. ensure the backend-action does not allow None for the is_internal field.
  2. 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

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions