Fix config value type
Hey! Thanks so much for testing and offering fixes and improvements!
Sending
ip
as a tuple of numbers is certainly a good idea. But there is an issue with the changes to the wrapConfig and wrapNestedTuples functions. Those are preparing the data to be send to the backend and when we need to send type object values (nested data), we need to send it as an array of tuples, not as an object.E.g.
{ "group": "pleroma", "key": "Pleroma.Upload", "value": [ {"tuple": [":proxy_opts", [ {"tuple": [":redirect_on_failure", false]}, {"tuple": [":max_body_length", 1048576]}, {"tuple": [":http": [ {"tuple": [":follow_redirect", true]}, {"tuple": [":pool", ":upload"]}, ]]} ] ]} ] }
Please provide more information if you think that we should still merged that part of your MR or we can just go ahead and merge the
ip
-related part.Those are preparing the data to be send to the backend and when we need to send type object values (nested data), we need to send it as an array of tuples, not as an object.
I understand. But if you leave it as it is, for example, the value of
:poll_limits
is changed from an object to a tuple, so will return an internal server error in/api/v1/instance
or/.well-known/nodeinfo/2.0.json
. Because it cannot be converted to json. To fix this bug, I tried not to change object to tuple in what was saved withmigrate_to_db
.changed this line in version 5 of the diff