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/mod_last #3750

Merged
merged 3 commits into from
Sep 23, 2022
Merged

c2s/mod_last #3750

merged 3 commits into from
Sep 23, 2022

Conversation

NelsonVides
Copy link
Collaborator

No description provided.

@NelsonVides NelsonVides changed the title mod_last c2s/mod_last Sep 3, 2022
@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

Base automatically changed from c2s/presences to feature/mongoose_c2s September 20, 2022 13:51
@mongoose-im
Copy link
Collaborator

mongoose-im commented Sep 20, 2022

ldap_mnesia_24 / ldap_mnesia / 49e6f5b
Reports root/ big
OK: 793 / Failed: 0 / User-skipped: 425 / Auto-skipped: 0


small_tests_24 / small_tests / 49e6f5b
Reports root / small


ldap_mnesia_25 / ldap_mnesia / 49e6f5b
Reports root/ big
OK: 793 / Failed: 0 / User-skipped: 425 / Auto-skipped: 0


small_tests_25 / small_tests / 49e6f5b
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 49e6f5b
Reports root/ big
OK: 2532 / Failed: 0 / User-skipped: 52 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / 49e6f5b
Reports root/ big
OK: 853 / Failed: 0 / User-skipped: 365 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 49e6f5b
Reports root/ big
OK: 2600 / Failed: 0 / User-skipped: 61 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 49e6f5b
Reports root/ big
OK: 1189 / Failed: 0 / User-skipped: 364 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 49e6f5b
Reports root/ big
OK: 2532 / Failed: 0 / User-skipped: 52 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 49e6f5b
Reports root/ big
OK: 2593 / Failed: 1 / User-skipped: 66 / Auto-skipped: 1

metrics_session_SUITE:session_global:session_global
{error,
  {{totalSessionCount,
     {value,1},
     [{times,25,
        {error,
          {badmatch,{value,0}},
          [{metrics_helper,assert_counter,3,
             [{file,
              "/home/circleci/project/big_tests/tests/metrics_helper.erl"},
            {line,36}]},
           {mongoose_helper,do_wait_until,2,
             [{file,
              "/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
            {line,374}]},
           {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}]}]}}]},
   [{mongoose_helper,do_wait_until,2,
      [{file,"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
       {line,371}]},
    {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


pgsql_mnesia_25 / pgsql_mnesia / 49e6f5b
Reports root/ big
OK: 2600 / Failed: 0 / User-skipped: 61 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / 49e6f5b
Reports root/ big
OK: 2515 / Failed: 0 / User-skipped: 69 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 49e6f5b
Reports root/ big
OK: 2532 / Failed: 0 / User-skipped: 52 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 49e6f5b
Reports root/ big
OK: 1036 / Failed: 0 / User-skipped: 349 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / 49e6f5b
Reports root/ big
OK: 2600 / Failed: 0 / User-skipped: 61 / Auto-skipped: 0

@codecov
Copy link

codecov bot commented Sep 20, 2022

Codecov Report

Base: 57.75% // Head: 57.80% // Increases project coverage by +0.05% 🎉

Coverage data is based on head (7985965) compared to base (6a2100c).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@                   Coverage Diff                    @@
##           feature/mongoose_c2s    #3750      +/-   ##
========================================================
+ Coverage                 57.75%   57.80%   +0.05%     
========================================================
  Files                       536      536              
  Lines                     34809    34822      +13     
========================================================
+ Hits                      20103    20129      +26     
+ Misses                    14706    14693      -13     
Impacted Files Coverage Δ
src/mod_last.erl 85.00% <100.00%> (+11.86%) ⬆️
src/elasticsearch/mongoose_elasticsearch.erl 76.92% <0.00%> (-7.70%) ⬇️
src/pubsub/node_pep.erl 68.51% <0.00%> (-5.56%) ⬇️
src/cassandra/mongoose_cassandra.erl 77.77% <0.00%> (-3.71%) ⬇️
src/cassandra/mongoose_cassandra_worker.erl 66.03% <0.00%> (-2.84%) ⬇️
src/mam/mod_mam_elasticsearch_arch.erl 86.60% <0.00%> (-1.79%) ⬇️
src/pubsub/mod_pubsub_db_rdbms.erl 68.99% <0.00%> (-0.52%) ⬇️
src/mod_roster.erl 71.29% <0.00%> (+0.23%) ⬆️
src/mod_muc_room.erl 46.84% <0.00%> (+0.96%) ⬆️
src/inbox/mod_inbox_rdbms_async.erl 73.52% <0.00%> (+1.47%) ⬆️
... 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.

@NelsonVides NelsonVides marked this pull request as ready for review September 20, 2022 14:23
Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

I added a few comments, please provide PR descriptions.

src/mod_last.erl Outdated
@@ -46,6 +46,7 @@
session_cleanup/5,
remove_domain/3,
remove_unused_backend_opts/1]).
-export([user_receive_iq/3]).
Copy link
Member

Choose a reason for hiding this comment

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

Minor: why is this one exported separately? The above are already IQ and hook handlers (two types of handlers), and they are exported together. So it looks like a minor inconsistency.

src/mod_last.erl Outdated
{From, To, _} = mongoose_acc:packet(Acc),
case {To#jid.lresource, can_respond(HostType, From, To)} of
{<<>>, _} ->
{ok, Acc};
Copy link
Member

Choose a reason for hiding this comment

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

Is this clause reachable? Wouldn't it be caught by the IQ handler?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, that is true!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The XMPP core itself says that IQs to a user without specifying the resource must be handled by the server on their behalf: https://www.rfc-editor.org/rfc/rfc6120#section-10.5.3.2

src/mod_last.erl Show resolved Hide resolved
src/mod_last.erl Show resolved Hide resolved
Copy link
Contributor

@arcusfelis arcusfelis 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

This module now implements a handler for an online user receiving an IQ,
which used to be in `ejabberd_c2s:handle_routed_iq/4`. This happens when
the IQ is directed to a full JID with a resource, but it still needs to
check if it is allowed to be routed, according to XEP-0012 saying:

> if the requesting entity is not authorized to view the user's presence
> information (normally via a presence subscription as defined in XMPP
> IM), the user's server MUST NOT deliver the IQ-get to an available
> resource but instead MUST return a <forbidden/> error in response to
> the last activity request.
https://xmpp.org/extensions/xep-0012.html#online
@mongoose-im
Copy link
Collaborator

mongoose-im commented Sep 23, 2022

small_tests_24 / small_tests / 7985965
Reports root / small


ldap_mnesia_24 / ldap_mnesia / 7985965
Reports root/ big
OK: 794 / Failed: 0 / User-skipped: 425 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / 7985965
Reports root/ big
OK: 794 / Failed: 0 / User-skipped: 425 / Auto-skipped: 0


small_tests_25 / small_tests / 7985965
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 7985965
Reports root/ big
OK: 2533 / Failed: 0 / User-skipped: 52 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 7985965
Reports root/ big
OK: 2601 / Failed: 0 / User-skipped: 61 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / 7985965
Reports root/ big
OK: 854 / Failed: 0 / User-skipped: 365 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 7985965
Reports root/ big
OK: 1190 / Failed: 0 / User-skipped: 364 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 7985965
Reports root/ big
OK: 2532 / Failed: 1 / User-skipped: 52 / Auto-skipped: 0

service_mongoose_system_metrics_SUITE:system_metrics_are_reported_to_configurable_google_analytics
{error,
  {{assertEqual,
     [{module,service_mongoose_system_metrics_SUITE},
      {line,470},
      {expression,"ActualTrackingIds"},
      {expected,[<<"UA-151671255-1">>,<<"UA-EXTRA-TRACKING-ID">>]},
      {value,[<<"UA-151671255-1">>]}]},
   [{service_mongoose_system_metrics_SUITE,
      events_are_reported_to_tracking_ids,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_mongoose_system_metrics_SUITE.erl"},
       {line,470}]},
    {service_mongoose_system_metrics_SUITE,
      system_metrics_are_reported_to_configurable_google_analytics,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_mongoose_system_metrics_SUITE.erl"},
       {line,204}]},
    {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 / 7985965
Reports root/ big
OK: 2516 / Failed: 0 / User-skipped: 69 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 7985965
Reports root/ big
OK: 2601 / Failed: 0 / User-skipped: 61 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 7985965
Reports root/ big
OK: 2594 / Failed: 1 / User-skipped: 66 / Auto-skipped: 1

metrics_session_SUITE:session_global:session_global
{error,
  {{totalSessionCount,
     {value,1},
     [{times,25,
        {error,
          {badmatch,{value,0}},
          [{metrics_helper,assert_counter,3,
             [{file,
              "/home/circleci/project/big_tests/tests/metrics_helper.erl"},
            {line,36}]},
           {mongoose_helper,do_wait_until,2,
             [{file,
              "/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
            {line,374}]},
           {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}]}]}}]},
   [{mongoose_helper,do_wait_until,2,
      [{file,"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
       {line,371}]},
    {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_mssql_mnesia_25 / odbc_mssql_mnesia / 7985965
Reports root/ big
OK: 2533 / Failed: 0 / User-skipped: 52 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / 7985965
Reports root/ big
OK: 2598 / Failed: 3 / User-skipped: 61 / Auto-skipped: 0

service_domain_db_SUITE:db:db_get_all_static
{error,
  {{badrpc,{'EXIT',{timeout,{gen_server,call,[service_domain_db,ping]}}}},
   [{distributed_helper,rpc,
      [#{node => mongooseim@localhost},service_domain_db,sync_local,[]],
      [{file,
         "/home/circleci/project/big_tests/tests/distributed_helper.erl"},
       {line,117}]},
    {service_domain_db_SUITE,sync_local,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1205}]},
    {service_domain_db_SUITE,sync,0,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1184}]},
    {service_domain_db_SUITE,db_get_all_static,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,356}]},
    {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

service_domain_db_SUITE:db:db_get_all_dynamic
{error,
  {{badrpc,timeout},
   [{distributed_helper,rpc,
      [#{node => mongooseim@localhost},service_domain_db,sync_local,[]],
      [{file,
         "/home/circleci/project/big_tests/tests/distributed_helper.erl"},
       {line,117}]},
    {service_domain_db_SUITE,sync_local,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1205}]},
    {service_domain_db_SUITE,sync,0,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1184}]},
    {service_domain_db_SUITE,db_get_all_dynamic,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,366}]},
    {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

service_domain_db_SUITE:db:db_out_of_sync_restarts_service
{error,
  {{badrpc,timeout},
   [{distributed_helper,rpc,
      [#{node => ejabberd2@localhost},service_domain_db,sync_local,[]],
      [{file,
         "/home/circleci/project/big_tests/tests/distributed_helper.erl"},
       {line,117}]},
    {service_domain_db_SUITE,sync_local,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1205}]},
    {service_domain_db_SUITE,db_out_of_sync_restarts_service,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,634}]},
    {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


riak_mnesia_24 / riak_mnesia / 7985965
Reports root/ big
OK: 1037 / Failed: 0 / User-skipped: 349 / Auto-skipped: 0

Copy link
Member

@chrzaszcz chrzaszcz 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 👍
There are random CI failures, but the docker image would not build anyway (failing small tests as expected).

@chrzaszcz chrzaszcz merged commit 5f5c26e into feature/mongoose_c2s Sep 23, 2022
@chrzaszcz chrzaszcz deleted the c2s/last branch September 23, 2022 09:49
@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.

None yet

5 participants