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

Refactored hook handlers in mod_pubsub #3879

Merged
merged 1 commit into from
Nov 29, 2022
Merged

Conversation

pawlooss1
Copy link
Member

This PR changes all hook handlers in mod_pubsub module to gen_hook format.

@mongoose-im

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Nov 29, 2022

Codecov Report

Base: 83.15% // Head: 83.14% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (929be75) compared to base (29e8228).
Patch coverage: 96.87% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3879      +/-   ##
==========================================
- Coverage   83.15%   83.14%   -0.01%     
==========================================
  Files         535      535              
  Lines       34202    34199       -3     
==========================================
- Hits        28440    28435       -5     
- Misses       5762     5764       +2     
Impacted Files Coverage Δ
src/mod_ping.erl 95.23% <ø> (ø)
src/pubsub/mod_pubsub.erl 73.08% <95.83%> (-0.16%) ⬇️
src/mongoose_hooks.erl 96.14% <100.00%> (+0.05%) ⬆️
...bal_distrib/mod_global_distrib_hosts_refresher.erl 66.66% <0.00%> (-2.23%) ⬇️
src/rdbms/mongoose_rdbms.erl 65.26% <0.00%> (-1.06%) ⬇️
...c/global_distrib/mod_global_distrib_server_mgr.erl 77.01% <0.00%> (-0.58%) ⬇️
src/ejabberd_c2s.erl 88.95% <0.00%> (-0.30%) ⬇️
src/mod_muc_log.erl 62.82% <0.00%> (ø)
src/pubsub/mod_pubsub_db_rdbms.erl 95.34% <0.00%> (+0.25%) ⬆️
src/domain/mongoose_domain_loader.erl 90.17% <0.00%> (+0.89%) ⬆️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pawlooss1 pawlooss1 marked this pull request as ready for review November 29, 2022 12:31
@mongoose-im
Copy link
Collaborator

mongoose-im commented Nov 29, 2022

small_tests_24 / small_tests / 929be75
Reports root / small


small_tests_25 / small_tests / 929be75
Reports root / small


ldap_mnesia_24 / ldap_mnesia / 929be75
Reports root/ big
OK: 2167 / Failed: 0 / User-skipped: 818 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 929be75
Reports root/ big
OK: 4116 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / 929be75
Reports root/ big
OK: 4090 / Failed: 0 / User-skipped: 114 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / 929be75
Reports root/ big
OK: 2167 / Failed: 0 / User-skipped: 818 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 929be75
Reports root/ big
OK: 4116 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 929be75
Reports root/ big
OK: 4115 / Failed: 1 / User-skipped: 88 / Auto-skipped: 0

muc_SUITE:register:user_submits_registration_form
{error,
  {{assertion_failed,assert,is_iq_result,
     [{xmlel,<<"iq">>,
        [{<<"type">>,<<"set">>},
         {<<"id">>,<<"00d146061e157520af91a5af4ae20d9d">>},
         {<<"to">>,<<"groupchats.domain.example.com">>}],
        [{xmlel,<<"query">>,
           [{<<"xmlns">>,<<"jabber:iq:register">>}],
           [{xmlel,<<"x">>,
            [{<<"xmlns">>,<<"jabber:x:data">>},
             {<<"type">>,<<"submit">>}],
            [{xmlel,<<"field">>,
               [{<<"type">>,<<"hidden">>},
                {<<"var">>,<<"FORM_TYPE">>}],
               [{xmlel,<<"value">>,[],
                  [{xmlcdata,<<"jabber:iq:register">>}]}]},
             {xmlel,<<"field">>,
               [{<<"type">>,<<"text-single">>},
                {<<"var">>,<<"nick">>}],
               [{xmlel,<<"value">>,[],
                  [{xmlcdata,
                     <<"thirdwitchroom-c92a51cfcd">>}]}]}]}]}]}],
     {xmlel,<<"iq">>,
       [{<<"from">>,<<"groupchats.domain.example.com">>},
        {<<"to">>,
         <<"alice_user_submits_registration_form_2497@domain.example.com/res1">>},
        {<<"type">>,<<"error">>},
        {<<"xml:lang">>,<<"en">>},
        {<<"id">>,<<"00d146061e157520af91a5af4ae20d9d">>}],
       [{xmlel,<<"query">>,
          [{<<"xmlns">>,<<"jabber:iq:register">>}],
          [{xmlel,<<"x">>,
             [{<<"xmlns">>,<<"jabber:x:data">>},
            {<<"type">>,<<"submit">>}],
             [{xmlel,<<"field">>,
              [{<<"type">>,<<"hidden">>},
               {...

Report log


pgsql_mnesia_24 / pgsql_mnesia / 929be75
Reports root/ big
OK: 4490 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / 929be75
Reports root/ big
OK: 2309 / Failed: 0 / User-skipped: 676 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 929be75
Reports root/ big
OK: 2503 / Failed: 0 / User-skipped: 651 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 929be75
Reports root/ big
OK: 4475 / Failed: 1 / User-skipped: 111 / Auto-skipped: 0

muc_SUITE:hibernation:hibernated_room_can_be_queried_for_archive
{error,{{assertion_failed,assert,is_groupchat_message,
              [<<"Restorable message">>],
              undefined,"undefined"},
    [{escalus_new_assert,assert_true,2,
               [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
                {line,84}]},
     {muc_SUITE,wait_for_mam_result,3,
          [{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
           {line,4394}]},
     {muc_SUITE,'-hibernated_room_can_be_queried_for_archive/1-fun-0-',3,
          [{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
           {line,4130}]},
     {escalus_story,story,4,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
             {line,72}]},
     {muc_SUITE,hibernated_room_can_be_queried_for_archive,1,
          [{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
           {line,4126}]},
     {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
     {test_server,run_test_case_eval1,6,
            [{file,"test_server.erl"},{line,1291}]},
     {test_server,run_test_case_eval,9,
            [{file,"test_server.erl"},{line,1223}]}]}}

Report log


pgsql_mnesia_25 / pgsql_mnesia / 929be75
Reports root/ big
OK: 4490 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 929be75
Reports root/ big
OK: 2662 / Failed: 0 / User-skipped: 662 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / 929be75
Reports root/ big
OK: 4490 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 929be75
Reports root/ big
OK: 4116 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 929be75
Reports root/ big
OK: 4476 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0

Copy link
Collaborator

@NelsonVides NelsonVides left a comment

Choose a reason for hiding this comment

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

LGTM 👌🏽

@@ -151,7 +151,7 @@ iq_ping(Acc, _From, _To, #iq{sub_el = SubEl} = IQ, _) ->

-spec handle_remote_hook(Acc, Params, Extra) -> {ok, Acc} when
Acc :: term(),
Params :: #{tag := atom(), args := term(), c2s_state := ejabberd_c2s:state()},
Params :: #{tag := atom(), hook_args := term(), c2s_state := ejabberd_c2s:state()},
Copy link
Collaborator

Choose a reason for hiding this comment

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

How comes dialyzer didn't complain here 😢

Comment on lines +127 to +151
affiliation_to_string/1,
create_node/7,
default_host/0,
delete_item/4,
delete_node/3,
extended_error/3,
get_cached_item/2,
get_item/3,
get_items/2,
host/2,
iq_sm/4,
node_action/4,
node_call/4,
plugin/2,
plugin/1,
publish_item/6,
send_items/7,
serverhost/1,
start_link/2,
string_to_affiliation/1,
string_to_subscription/1,
subscribe_node/5,
subscription_to_string/1,
tree_action/3,
unsubscribe_node/5,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if all these ignore_xrefs are really needed, but I don't know 🙄

@NelsonVides NelsonVides merged commit fe6f638 into master Nov 29, 2022
@NelsonVides NelsonVides deleted the hooks/mod_pubsub branch November 29, 2022 13:23
@chrzaszcz chrzaszcz added this to the 6.0.0 milestone Dec 12, 2022
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