Closed peb-adr closed 2 years ago
@gsiv FYI as well
@peb-adr I think your change does not work. If you change the proto file you have to re-generated the respective code using the protoc
Makefile target. But I think your syntax of the file is wrong. map<string, string> should be correct also for the new format (and that's way it seems to work already. Maybe there is a test ... ;-)
@normanjaeckel
Ok, I'll provide more info.
I have an instance running on the latest tag (4.0.0-dev-20220128-714a03c)
Including the manage service and tool running on master (before this PR).
Now openslides create-user -f user.yml
gives this output:
Error: creating user: calling manage service: calling handler: requesting backend action "user.create": got response "400 BAD REQUEST": "{\"success\": false, \"message\": \"data.committee_$_management_level must not contain {'1'} properties\", \"action_error_index\": 0, \"action_data_error_index\": 0}"
So the backend apparently doesn't accept the request anymore.
After a bit of try and error with curl
and looking at
https://github.com/OpenSlides/openslides-backend/commit/26788dd5e465e54267eddb5a1d338931438b05cb
as well as
https://github.com/OpenSlides/OpenSlides/commit/714a03c1544e96f22a92550575157c01785e9822
I concluded committee_$_management_level
is no longer a map[id -> 'can_manage']
but rather a map['can_manage' -> array[ids] ]
(Maybe @r-peschke can confirm this.)
So then I went ahead and changed the request definition in the proto file.
I ran make protoc
, make go-build
, docker build .
The restarted the instance using the new manage image.
And now the backend accepts the create-user request.
and that's way it seems to work already
So I'm pretty sure this change is needed. My mistake I'm seeing, is that i forgot to also commit the regenerated proto files. Would you agree now, that by pushing them too this PR is fine?
@normanjaeckel Ok, I'll provide more info. I have an instance running on the latest tag (4.0.0-dev-20220128-714a03c) Including the manage service and tool running on master (before this PR). Now
openslides create-user -f user.yml
gives this output:Error: creating user: calling manage service: calling handler: requesting backend action "user.create": got response "400 BAD REQUEST": "{\"success\": false, \"message\": \"data.committee_$_management_level must not contain {'1'} properties\", \"action_error_index\": 0, \"action_data_error_index\": 0}"
So the backend apparently doesn't accept the request anymore. After a bit of try and error with
curl
and looking at OpenSlides/openslides-backend@26788dd as well as OpenSlides/OpenSlides@714a03c I concludedcommittee_$_management_level
is no longer amap[id -> 'can_manage']
but rather amap['can_manage' -> array[ids] ]
(Maybe @r-peschke can confirm this.)
Yes, you are right, it is a map, that accepts a string from the replacementenum of the field committee$_management and an array of [ids]. The "source of truth" is the wiki, for this case see https://github.com/OpenSlides/OpenSlides/wiki/user.create
@normanjaeckel The payload for the user.create action changed in backend. i.e. the provided payload format must change from:
to:
I'll merge this right away, as it's a very minor change. Tested it as well ofc.