Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MUC commands with dynamic domains #3248

Merged
merged 4 commits into from
Sep 8, 2021
Merged

Conversation

chrzaszcz
Copy link
Member

@chrzaszcz chrzaszcz commented Sep 8, 2021

Support dynamic domains in mod_muc_commands

This module (just like the other command modules) would benefit from a more substantial rework, including:

  • Better error handling. Each call to jid:make, jid:from_binary etc can return an error. This is also relevant to mongoose_domain_api:get_domain_host_type.
  • Type specs - not sure here, the functions will need some changes soon anyway.
  • More consistency between the MUC and MUC Light API.

Such changes are not done as a part of this PR, as they fall out of scope. They can be done with the command/admin API rework that we need to do separately.

@codecov
Copy link

codecov bot commented Sep 8, 2021

Codecov Report

Merging #3248 (db507c8) into master (6649962) will decrease coverage by 0.01%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3248      +/-   ##
==========================================
- Coverage   80.33%   80.32%   -0.02%     
==========================================
  Files         398      398              
  Lines       32550    32549       -1     
==========================================
- Hits        26150    26144       -6     
- Misses       6400     6405       +5     
Impacted Files Coverage Δ
src/mod_muc_commands.erl 94.82% <91.66%> (-0.09%) ⬇️
src/event_pusher/mod_event_pusher_sns.erl 84.21% <0.00%> (-5.27%) ⬇️
src/mongoose_tcp_listener.erl 76.59% <0.00%> (-4.26%) ⬇️
src/mod_last_rdbms.erl 91.66% <0.00%> (-4.17%) ⬇️
...bal_distrib/mod_global_distrib_hosts_refresher.erl 71.69% <0.00%> (-1.89%) ⬇️
src/mod_last.erl 86.36% <0.00%> (-1.52%) ⬇️
src/muc_light/mod_muc_light_db_mnesia.erl 88.54% <0.00%> (-1.05%) ⬇️
src/global_distrib/mod_global_distrib_utils.erl 64.48% <0.00%> (-0.94%) ⬇️
src/ejabberd_c2s.erl 89.00% <0.00%> (-0.08%) ⬇️
src/mod_muc_log.erl 77.88% <0.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6649962...db507c8. Read the comment docs.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Sep 8, 2021

small_tests_24 / small_tests / db507c8
Reports root / small


internal_mnesia_24 / internal_mnesia / db507c8
Reports root/ big
OK: 1588 / Failed: 0 / User-skipped: 290 / Auto-skipped: 0


small_tests_22 / small_tests / db507c8
Reports root / small


dynamic_domains_23 / pgsql_mnesia / db507c8
Reports root/ big
OK: 1728 / Failed: 0 / User-skipped: 112 / Auto-skipped: 0


dynamic_domains_24 / pgsql_mnesia / db507c8
Reports root/ big
OK: 1728 / Failed: 0 / User-skipped: 112 / Auto-skipped: 0


small_tests_23 / small_tests / db507c8
Reports root / small


ldap_mnesia_24 / ldap_mnesia / db507c8
Reports root/ big
OK: 1515 / Failed: 0 / User-skipped: 363 / Auto-skipped: 0


ldap_mnesia_22 / ldap_mnesia / db507c8
Reports root/ big
OK: 1515 / Failed: 0 / User-skipped: 363 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / db507c8
Reports root/ big
OK: 1515 / Failed: 0 / User-skipped: 363 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / db507c8
Reports root/ big
OK: 3090 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / db507c8
Reports root/ big
OK: 1891 / Failed: 0 / User-skipped: 286 / Auto-skipped: 0


pgsql_mnesia_22 / pgsql_mnesia / db507c8
Reports root/ big
OK: 3090 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / db507c8
Reports root/ big
OK: 3073 / Failed: 0 / User-skipped: 201 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / db507c8
Reports root/ big
OK: 3090 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / db507c8
Reports root/ big
OK: 3085 / Failed: 5 / User-skipped: 184 / Auto-skipped: 0

inbox_SUITE:muclight:groupchat_markers_one_reset_room_created
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"alicE_groupchat_markers_one_reset_room_created_80.522333@localhost/res1">>,
          escalus_tcp,<0.18075.0>,
          [{event_manager,<0.18035.0>},
           {server,<<"localhost">>},
           {username,
             <<"alicE_groupchat_markers_one_reset_room_created_80.522333">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.18035.0>},
            {server,<<"localhost">>},
            {username,
              <<"alicE_groupchat_markers_one_reset_room_created_80.522333">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,
             <<"alicE_groupchat_markers_one_reset_room_created_80.522333">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,
             <<"alicE_groupchat_markers_one_reset_room_created_80.522333">>},
           {server,<<"localhost">>},
           {password,<<"matygrysa">>},
           {stream_id,<<"4f9ee342bb36cae6">>}]},
        5000],
       [{file,
          "/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {muc_helper,'-foreach_recipient/2-fun-0-',2,
       [{file,"/home/circleci/app/big_tests/tests/muc_helper.erl"},
        {line,45}]},
    ...

Report log

inbox_SUITE:muclight:create_groupchat
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,<<"bOb_create_groupchat_80.527245@localhost/res1">>,
          escalus_tcp,<0.18084.0>,
          [{event_manager,<0.18049.0>},
           {server,<<"localhost">>},
           {username,<<"bOb_create_groupchat_80.527245">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.18049.0>},
            {server,<<"localhost">>},
            {username,<<"bOb_create_groupchat_80.527245">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,<<"bOb_create_groupchat_80.527245">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,<<"bOb_create_groupchat_80.527245">>},
           {server,<<"localhost">>},
           {password,<<"makrolika">>},
           {stream_id,<<"2b9f2d4471839887">>}]},
        5000],
       [{file,
          "/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {muc_helper,'-foreach_recipient/2-fun-0-',2,
       [{file,"/home/circleci/app/big_tests/tests/muc_helper.erl"},
        {line,45}]},
     {lists,foreach,2,[{file,"lists.erl"},{line,1342}]},
     {muc_light_helper,verify_aff_bcast,3,
       [{file,"/home/circleci/app/big_tests/tests/muc_light_helper.erl"},
        {line,140}]},
     {...

Report log

inbox_SUITE:muclight:leave_and_remove_conversation
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"alicE_leave_and_remove_conversation_80.527917@localhost/res1">>,
          escalus_tcp,<0.18077.0>,
          [{event_manager,<0.18056.0>},
           {server,<<"localhost">>},
           {username,
             <<"alicE_leave_and_remove_conversation_80.527917">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.18056.0>},
            {server,<<"localhost">>},
            {username,
              <<"alicE_leave_and_remove_conversation_80.527917">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,
             <<"alicE_leave_and_remove_conversation_80.527917">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,
             <<"alicE_leave_and_remove_conversation_80.527917">>},
           {server,<<"localhost">>},
           {password,<<"matygrysa">>},
           {stream_id,<<"f25047e79283d4e9">>}]},
        5000],
       [{file,
          "/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {muc_light_helper,given_muc_light_room,3,
       [{file,"/home/circleci/app/big_tests/tests/muc_light_helper.erl"},
        {line,54}]},
     {inbox_helper,create_room,3,
       [{file,"/home/c...

Report log

inbox_SUITE:muclight:non_reset_marker_should_not_affect_muclight_inbox
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"alicE_non_reset_marker_should_not_affect_muclight_inbox_80.531392@localhost/res1">>,
          escalus_tcp,<0.18078.0>,
          [{event_manager,<0.18070.0>},
           {server,<<"localhost">>},
           {username,
             <<"alicE_non_reset_marker_should_not_affect_muclight_inbox_80.531392">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.18070.0>},
            {server,<<"localhost">>},
            {username,
              <<"alicE_non_reset_marker_should_not_affect_muclight_inbox_80.531392">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,
             <<"alicE_non_reset_marker_should_not_affect_muclight_inbox_80.531392">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,
             <<"alicE_non_reset_marker_should_not_affect_muclight_inbox_80.531392">>},
           {server,<<"localhost">>},
           {password,<<"matygrysa">>},
           {stream_id,<<"a79fe7835cc535a0">>}]},
        5000],
       [{file,
          "/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {muc_light_helper,given_muc_light_room,3,
       [{file,"/home/circleci/app/big_tests/tests/m...

Report log

inbox_SUITE:muclight:groupchat_reset_stanza_resets_inbox
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"bOb_groupchat_reset_stanza_resets_inbox_80.518184@localhost/res1">>,
          escalus_tcp,<0.18085.0>,
          [{event_manager,<0.18028.0>},
           {server,<<"localhost">>},
           {username,
             <<"bOb_groupchat_reset_stanza_resets_inbox_80.518184">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.18028.0>},
            {server,<<"localhost">>},
            {username,
              <<"bOb_groupchat_reset_stanza_resets_inbox_80.518184">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,
             <<"bOb_groupchat_reset_stanza_resets_inbox_80.518184">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,
             <<"bOb_groupchat_reset_stanza_resets_inbox_80.518184">>},
           {server,<<"localhost">>},
           {password,<<"makrolika">>},
           {stream_id,<<"c22b4b6ed513c673">>}]},
        5000],
       [{file,
          "/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {inbox_helper,mark_last_muclight_system_message,3,
       [{file,"/home/circleci/app/big_tests/tests/inbox_helper.erl"},
        {line,579}]},
     {inbox_helper,'-create_ro...

Report log


riak_mnesia_24 / riak_mnesia / db507c8
Reports root/ big
OK: 1738 / Failed: 0 / User-skipped: 289 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / db507c8
Reports root/ big
OK: 3090 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0

@chrzaszcz chrzaszcz marked this pull request as ready for review September 8, 2021 12:59
Copy link
Contributor

@Premwoik Premwoik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@vkatsuba vkatsuba merged commit 0d49bfe into master Sep 8, 2021
@vkatsuba vkatsuba deleted the muc-commands-with-dynamic-domains branch September 8, 2021 14:30
@Premwoik Premwoik added this to the 5.0.0 milestone Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants