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

C2s/refactor user send packet #3857

Merged
merged 5 commits into from
Nov 16, 2022

Conversation

NelsonVides
Copy link
Collaborator

@NelsonVides NelsonVides commented Nov 15, 2022

user_send_packet subscribers can really be split into different handlers for messages or presences as needed, considering most often they only need messages like in the case of MAM, inbox, or carbon-copies.

This PR also fixes usages of types that don't exist anymore: mongoose_c2s:hook_result() was moved to mongoose_c2s_hooks:hook_result(), which in turn I here abbreviate to mongoose_c2s_hooks:result(), as the module name already contains the fact that we're referring to hooks. Similarly for other types defined in the c2s_hooks module.

@mongoose-im

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Nov 15, 2022

Codecov Report

Base: 72.11% // Head: 72.09% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (611afee) compared to base (707f6d6).
Patch coverage: 85.71% of modified lines in pull request are covered.

Additional details and impacted files
@@                   Coverage Diff                    @@
##           feature/mongoose_c2s    #3857      +/-   ##
========================================================
- Coverage                 72.11%   72.09%   -0.03%     
========================================================
  Files                       534      534              
  Lines                     34012    34009       -3     
========================================================
- Hits                      24527    24518       -9     
- Misses                     9485     9491       +6     
Impacted Files Coverage Δ
src/c2s/mongoose_c2s_listener.erl 85.71% <ø> (ø)
.../event_pusher/mod_event_pusher_hook_translator.erl 80.55% <ø> (ø)
src/jingle_sip/mod_jingle_sip.erl 1.17% <ø> (ø)
src/metrics/mongoose_metrics_hooks.erl 97.43% <ø> (ø)
src/mod_amp.erl 96.51% <ø> (ø)
src/mod_last.erl 88.75% <ø> (ø)
src/mod_ping.erl 98.38% <ø> (ø)
src/mod_presence.erl 85.80% <ø> (ø)
src/mod_register.erl 76.44% <ø> (ø)
src/mongoose_hooks.erl 87.73% <ø> (-0.17%) ⬇️
... and 19 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.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Nov 15, 2022

small_tests_24 / small_tests / 611afee
Reports root / small


small_tests_25 / small_tests / 611afee
Reports root / small


ldap_mnesia_24 / ldap_mnesia / 611afee
Reports root/ big
OK: 1568 / Failed: 0 / User-skipped: 701 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / 611afee
Reports root/ big
OK: 1568 / Failed: 0 / User-skipped: 701 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 611afee
Reports root/ big
OK: 3582 / Failed: 0 / User-skipped: 78 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / 611afee
Reports root/ big
OK: 1657 / Failed: 0 / User-skipped: 612 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 611afee
Reports root/ big
OK: 3758 / Failed: 0 / User-skipped: 89 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 611afee
Reports root/ big
OK: 3582 / Failed: 0 / User-skipped: 78 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 611afee
Reports root/ big
OK: 3750 / Failed: 2 / User-skipped: 103 / Auto-skipped: 0

mod_event_pusher_rabbit_SUITE:group_chat_message_publish:group_chat_message_received_event_properly_formatted
{error,
  {{assertMatch,
     [{module,mod_event_pusher_rabbit_SUITE},
      {line,422},
      {expression,
        "get_decoded_message_from_rabbit ( AliceGroupChatMsgRecvRK )"},
      {pattern,
        "# { << \"from_user_id\" >> := BobRoomJID , << \"to_user_id\" >> := AliceFullJID , << \"message\" >> := Message }"},
      {value,
        #{<<"from_user_id">> => <<"muc_publish@muc.localhost">>,
        <<"message">> => <<>>,
        <<"to_user_id">> =>
          <<"alice_unnamed_2052@localhost/res1">>}}]},
   [{mod_event_pusher_rabbit_SUITE,
      '-group_chat_message_received_event_properly_formatted/1-fun-1-',3,
      [{file,
         "/home/circleci/project/big_tests/tests/mod_event_pusher_rabbit_SUITE.erl"},
       {line,422}]},
    {escalus_story,story,4,
      [{file,
         "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
       {line,72}]},
    {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

mod_event_pusher_rabbit_SUITE:group_chat_message_publish:group_chat_message_received_event_properly_formatted
{error,
  {{assertMatch,
     [{module,mod_event_pusher_rabbit_SUITE},
      {line,422},
      {expression,
        "get_decoded_message_from_rabbit ( AliceGroupChatMsgRecvRK )"},
      {pattern,
        "# { << \"from_user_id\" >> := BobRoomJID , << \"to_user_id\" >> := AliceFullJID , << \"message\" >> := Message }"},
      {value,
        #{<<"from_user_id">> =>
          <<"muc_publish@muc.localhost/bob_unnamed_2053">>,
        <<"message">> => <<"Hi there!">>,
        <<"to_user_id">> =>
          <<"alice_unnamed_2056@localhost/res1">>}}]},
   [{mod_event_pusher_rabbit_SUITE,
      '-group_chat_message_received_event_properly_formatted/1-fun-1-',3,
      [{file,
         "/home/circleci/project/big_tests/tests/mod_event_pusher_rabbit_SUITE.erl"},
       {line,422}]},
    {escalus_story,story,4,
      [{file,
         "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
       {line,72}]},
    {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


dynamic_domains_mysql_redis_25 / mysql_redis / 611afee
Reports root/ big
OK: 3555 / Failed: 1 / User-skipped: 104 / Auto-skipped: 0

rest_SUITE:admin:session_can_be_kicked
{error,{test_case_failed,[70,97,105,108,58,32,
              [60,60,
               "\"alice_session_can_be_kicked_2113@domain.example.com/res1\"",
               62,62],
              32,105,110,32,
              [91,
               [[60,60,
               "\"alice_stanzas_are_sent_and_received_2116@domain.example.com/res1\"",
               62,62],
              44,10,
              [32,
               [[[32,["  ",32,32],"  ",32,32],
                 32,
                 ["  ",32,32],
                 "  ",32,32],
                [32,["  ",32,32],"  ",32,32],
                32,
                ["  ",32,32],
                "  ",32,32],
               [[32,["  ",32,32],"  ",32,32],
                32,
                ["  ",32,32],
                "  ",32,32],
               [32,["  ",32,32],"  ",32,32],
               32,
               ["  ",32,32],
               "  ",32,32],
              [60,60,
               "\"alice_messages_can_be_paginated_2119@domain.example.com/res1\"",
               62,62],
              44,10,
              [32,
               [[[32,["  ",32,32],"  ",32,32],
                 32,
                 ["  ",32,32],
                 "  ",32,32],
                [32,["  ",32,32],"  ",32,32],
                32,
                ["  ",32,32],
                "  ",32,32],
               [[32,["  ",32,32],"  ",32,32],
                32,
                ["  ",32,32],
                "  ",32,32],
               [32,["  ",32,32],"  ",32,32],
               ...

Report log


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 611afee
Reports root/ big
OK: 1993 / Failed: 0 / User-skipped: 611 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 611afee
Reports root/ big
OK: 3582 / Failed: 0 / User-skipped: 78 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 611afee
Reports root/ big
OK: 3758 / Failed: 0 / User-skipped: 89 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / 611afee
Reports root/ big
OK: 3556 / Failed: 0 / User-skipped: 104 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 611afee
Reports root/ big
OK: 3744 / Failed: 0 / User-skipped: 103 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / 611afee
Reports root/ big
OK: 3757 / Failed: 1 / User-skipped: 89 / Auto-skipped: 0

service_domain_db_SUITE:db:db_event_could_appear_with_lower_id
{error,
  {{badmatch,898},
   [{service_domain_db_SUITE,db_event_could_appear_with_lower_id,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,723}]},
    {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


mssql_mnesia_25 / odbc_mssql_mnesia / 611afee
Reports root/ big
OK: 3758 / Failed: 0 / User-skipped: 89 / Auto-skipped: 0

@NelsonVides NelsonVides marked this pull request as ready for review November 15, 2022 17:56
Copy link

@kamilwaz kamilwaz 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 👍

@kamilwaz kamilwaz merged commit a59c2b3 into feature/mongoose_c2s Nov 16, 2022
@kamilwaz kamilwaz deleted the c2s/refactor_user_send_packet branch November 16, 2022 08:55
@jacekwegr jacekwegr added this to the 6.1.0 milestone Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants