processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/en/ejabberd/
Other
6.01k stars 1.5k forks source link

create_room_with_opts doen't work anymore as per documentation #4248

Closed elenaapp closed 1 week ago

elenaapp commented 1 week ago

Environment

Bevor the update, I used this code for create the room with otptions. I use Flutter this Map worked

 final Map<String, dynamic> body = {
      'name': await EmailProcessor(emailController.text).jabberId,
      'service': 'myservice',
      'host': 'myhost',
      'options' : [{
        "name" : "persistent",
        "value" :"true"
      }]
      };

Now it didn't work anymore. I revice this error on the console

flutter ( 9755): Create Room - Fehler: 400
I/flutter ( 9755): Create Room -Body: "Arg 
#{<<110,97,109,101>> => <<112,101,114,115,105,115,116,101,110,116>>,
  <<118,97,108,117,101>> => <<116,114,117,101>>}
 is not in format {tuple,[{name,binary},{value,binary}]}"
I/flutter ( 9755): Create Room - Invalid JSON in response body

Errors from error.log/crash.log

2024-07-04 21:56:50.385254+02:00 [error] <0.2179.0>@mod_http_api:format_arg/2:378 Don't know how to format Arg #{<<"name">>
 => <<"persistent">>,
                               <<"value">> => <<"true">>} for format {tuple,
                                                                      [{name,
                                                                        binary},
                                                                       {value,
                                                                        binary}]}

Bug description

I expeted, that the room will be created with the options, that I need as before the update. What is changed? and how I can use the api correctly? Thank you in advance

badlop commented 1 week ago

Right, this problem appeared in ejabberd 24.06. It was also reported in #4242.

It is fixed by commit https://github.com/processone/ejabberd/commit/4192190a963b38941e39f78cc24f588435d26e5c which is included in git master branch. You can compile ejabberd from master branch.

If you use binary installers, you can download binary installers that are built using git master: go to https://github.com/processone/ejabberd/actions/runs/9796444127 on the Artifacts on the bottom of that page, "ejabberd-packages" is a zip file with all binary installers.

Once you can try this, please comment if it solved the problem.

elenaapp commented 1 week ago

Hello Badlop, I installed the debian package and now all works fine. thank you.