You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When calling the UpdateProgram GRPC service, any field in the input Program object that is left empty (name={} instead of name={value=""}) causes that value in the Program to be set to 0 or "".
This means that to update a single field we need to call GetProgram from Program-Service, provide all the values we want to stay the same, and update the ones we want to change. There should be no need for the client to provide the values that are not changing.
Steps To Reproduce
Steps to reproduce the behaviour:
Call UpdateProgram with the following body :
{
"program": {
"short_name": {
"value": "{{ShortName of a program you don't mind losing data from}}"
},
"description": {
},
"name": {
},
"membership_type": {
},
"commitment_donors": {
},
"submitted_donors": {
},
"genomic_donors": {
},
"website": {
"value": "Hello"
},
"institutions": {
},
"countries": {
"value": "Hello"
},
"regions": {
},
"cancer_types": [
],
"primary_sites": [
]
}
}
Call GetProgram for the same program (or check database)
All values of the program are now empty.
Expected behaviour
No changes to the program from before.
Note: I didn't test the above because I don't want to wipe anything, but I hope that illustrates the problem. That should be a valid message body indicating no change to those fields.
Note 2: There is no object wrapper on PrimarySite or CancerType, so there is no way to indicate we don't want to change those. We will also need to modify the message structure to put those in a {value:[]} structure if we want to support this behaviour in UpdateProgram.
The text was updated successfully, but these errors were encountered:
In the gateway we've put a work around in place to deal with the current issue. We call getProgram, get all the values, provide them all with the ones we want to update chagned. Thus, update program is a 2 call action until this is addressed.
alekspejovic
changed the title
🐛 UpdateProgram is setting values to 0 or empty when no value is provided
UpdateProgram is setting values to 0 or empty when no value is provided
Jul 22, 2019
Describe the bug
When calling the UpdateProgram GRPC service, any field in the input Program object that is left empty (
name={}
instead ofname={value=""
}) causes that value in the Program to be set to 0 or "".This means that to update a single field we need to call GetProgram from Program-Service, provide all the values we want to stay the same, and update the ones we want to change. There should be no need for the client to provide the values that are not changing.
Steps To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
No changes to the program from before.
Note: I didn't test the above because I don't want to wipe anything, but I hope that illustrates the problem. That should be a valid message body indicating no change to those fields.
Note 2: There is no object wrapper on PrimarySite or CancerType, so there is no way to indicate we don't want to change those. We will also need to modify the message structure to put those in a {value:[]} structure if we want to support this behaviour in UpdateProgram.
The text was updated successfully, but these errors were encountered: