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/merge master #3904

Merged
merged 50 commits into from
Dec 16, 2022
Merged

C2s/merge master #3904

merged 50 commits into from
Dec 16, 2022

Conversation

NelsonVides
Copy link
Collaborator

Three commits, first is the merge, second has the conflicts resolved, third has the fixes specific for this branch.

Kamil Waz and others added 30 commits December 1, 2022 15:34
The goal is to handle the error cases:
- Non-existing users shouldn't be room owners or message senders
- 'Room not found' should be returned if the room does not exist

Other functional changes:
- Name and subject are not required, because they shouldn't be.
  They have defaults, and they can be removed in a custom config schema.
- Only room owner should be able to kick room members.

Operations are broken into reusable steps, and a fold operation is
used to iterate over them.
- Handle the new error cases from the API module.
- Pass name and subject in the config map.
- Remove permission checking, which is done in mod_muc_light_api now.
- Update some operation names
- Pass room name and subject in a map
- Convert printed JIDs to binaries
- Protect 'mucDomain' on room creation.
  The reason is that a domain admin shouldn't be able to create a room
  at a different domain. The operation directly calls the MUC Light backend.
- Room JID is always bare
- Require 'mod_mam_muc' for message archive
- Make name and subject optional, as they should be.
  they have default values, and the user could even remove them from the
  config schema.
- Run the archive-related tests with and without MAM
- Test the new error conditions
Handle new error conditions.
Co-authored-by: Nelson Vides <[email protected]>
Improve error handling in session
Refactored hook handlers in ejabberd_ctl
Also added links to the releases (to be consistent).
Bullet points are more easy to read.
Added more info, for example, for years 2018-2019.
Removed Next, Next, Next sentences, because the order is in reverse.
None of the remaining HTTP handlers have 'cowboy' in their names,
and there is no reason why the user would have to know that currently
we are using Cowboy. This is an implementation detail that might
change anyway.
Improve error handling in vcard
The latest version of 'egrep' prints the following warning:

egrep: warning: egrep is obsolescent; using grep -E

Also: don't use the '-e' option when not necessary.
@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 15, 2022

small_tests_24 / small_tests / d0ead02
Reports root / small


small_tests_25 / small_tests / d0ead02
Reports root / small


ldap_mnesia_24 / ldap_mnesia / d0ead02
Reports root/ big
OK: 1734 / Failed: 0 / User-skipped: 797 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / d0ead02
Reports root/ big
OK: 3868 / Failed: 0 / User-skipped: 78 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / d0ead02
Reports root/ big
OK: 1734 / Failed: 0 / User-skipped: 797 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / d0ead02
Reports root/ big
OK: 4044 / Failed: 0 / User-skipped: 89 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / d0ead02
Reports root/ big
OK: 2076 / Failed: 0 / User-skipped: 624 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / d0ead02
Reports root/ big
OK: 1886 / Failed: 0 / User-skipped: 645 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / d0ead02
Reports root/ big
OK: 2238 / Failed: 0 / User-skipped: 632 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / d0ead02
Reports root/ big
OK: 3868 / Failed: 0 / User-skipped: 78 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / d0ead02
Reports root/ big
OK: 3842 / Failed: 0 / User-skipped: 104 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / d0ead02
Reports root/ big
OK: 4044 / Failed: 0 / User-skipped: 89 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / d0ead02
Reports root/ big
OK: 4030 / Failed: 0 / User-skipped: 103 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / d0ead02
Reports root/ big
OK: 3868 / Failed: 0 / User-skipped: 78 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / d0ead02
Reports root/ big
OK: 4039 / Failed: 4 / User-skipped: 89 / Auto-skipped: 1

service_domain_db_SUITE:db:db_inserted_from_one_node_while_service_disabled_on_another
{error,
  {{badrpc,timeout},
   [{distributed_helper,rpc,
      [#{node => mongooseim2@localhost},service_domain_db,sync_local,[]],
      [{file,
         "/home/circleci/project/big_tests/tests/distributed_helper.erl"},
       {line,121}]},
    {service_domain_db_SUITE,sync_local,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1247}]},
    {service_domain_db_SUITE,
      db_inserted_from_one_node_while_service_disabled_on_another,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,605}]},
    {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_reinserted_from_one_node_while_service_disabled_on_another
{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,121}]},
    {service_domain_db_SUITE,sync_local,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1247}]},
    {service_domain_db_SUITE,sync,0,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1226}]},
    {service_domain_db_SUITE,
      db_reinserted_from_one_node_while_service_disabled_on_another,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,612}]},
    {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 => mongooseim@localhost},service_domain_db,sync_local,[]],
      [{file,
         "/home/circleci/project/big_tests/tests/distributed_helper.erl"},
       {line,121}]},
    {service_domain_db_SUITE,sync_local,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1247}]},
    {service_domain_db_SUITE,sync,0,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,1226}]},
    {service_domain_db_SUITE,db_out_of_sync_restarts_service,1,
      [{file,
         "/home/circleci/project/big_tests/tests/service_domain_db_SUITE.erl"},
       {line,643}]},
    {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_restarts_properly
{error,{{timeout,true,[{times,150,false}]},
    [{mongoose_helper,do_wait_until,2,
              [{file,"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
               {line,371}]},
     {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 / d0ead02
Reports root/ big
OK: 4038 / Failed: 6 / User-skipped: 89 / Auto-skipped: 0

smart_markers_SUITE:regular:one2one:marker_after_timestamp_can_be_fetched
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"alice_marker_after_timestamp_can_be_fetched_2648@localhost/res1">>,
          escalus_tcp,<0.27049.2>,
          [{event_manager,<0.27020.2>},
           {server,<<"localhost">>},
           {username,
             <<"alicE_marker_after_timestamp_can_be_fetched_2648">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.27020.2>},
            {server,<<"localhost">>},
            {username,
              <<"alicE_marker_after_timestamp_can_be_fetched_2648">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,
             <<"alice_marker_after_timestamp_can_be_fetched_2648">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,
             <<"alicE_marker_after_timestamp_can_be_fetched_2648">>},
           {server,<<"localhost">>},
           {password,<<"matygrysa">>},
           {stream_id,<<"bf3e659816ce7712">>}]},
        5000],
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {smart_markers_SUITE,
       '-marker_after_timestamp_can_be_fetched/1-fun-0-',2,
       [{file,
          "/home/circleci/project/big_tests/tests/smart_markers_SUITE.erl"},
...

Report log

smart_markers_SUITE:regular:one2one:marker_for_thread_can_be_fetched
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"alice_marker_for_thread_can_be_fetched_2647@localhost/res1">>,
          escalus_tcp,<0.27048.2>,
          [{event_manager,<0.27013.2>},
           {server,<<"localhost">>},
           {username,
             <<"alicE_marker_for_thread_can_be_fetched_2647">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.27013.2>},
            {server,<<"localhost">>},
            {username,
              <<"alicE_marker_for_thread_can_be_fetched_2647">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,
             <<"alice_marker_for_thread_can_be_fetched_2647">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,
             <<"alicE_marker_for_thread_can_be_fetched_2647">>},
           {server,<<"localhost">>},
           {password,<<"matygrysa">>},
           {stream_id,<<"9604a7c407468b27">>}]},
        5000],
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {smart_markers_SUITE,'-marker_for_thread_can_be_fetched/1-fun-0-',2,
       [{file,
          "/home/circleci/project/big_tests/tests/smart_markers_SUITE.erl"},
        {line,208}]},
     {escalus_st...

Report log

smart_markers_SUITE:regular:one2one:repeated_markers_produce_no_warnings
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"alice_repeated_markers_produce_no_warnings_2651@localhost/res1">>,
          escalus_tcp,<0.27057.2>,
          [{event_manager,<0.27044.2>},
           {server,<<"localhost">>},
           {username,
             <<"alicE_repeated_markers_produce_no_warnings_2651">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.27044.2>},
            {server,<<"localhost">>},
            {username,
              <<"alicE_repeated_markers_produce_no_warnings_2651">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,
             <<"alice_repeated_markers_produce_no_warnings_2651">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,
             <<"alicE_repeated_markers_produce_no_warnings_2651">>},
           {server,<<"localhost">>},
           {password,<<"matygrysa">>},
           {stream_id,<<"423a38ef4222a486">>}]},
        5000],
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {smart_markers_SUITE,
       '-repeated_markers_produce_no_warnings/1-fun-1-',2,
       [{file,
          "/home/circleci/project/big_tests/tests/smart_markers_SUITE.erl"},
      ...

Report log

smart_markers_SUITE:regular:one2one:marker_after_timestamp_for_threadid_can_be_fetched
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"alice_marker_after_timestamp_for_threadid_can_be_fetched_2649@localhost/res1">>,
          escalus_tcp,<0.27052.2>,
          [{event_manager,<0.27027.2>},
           {server,<<"localhost">>},
           {username,
             <<"alicE_marker_after_timestamp_for_threadid_can_be_fetched_2649">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.27027.2>},
            {server,<<"localhost">>},
            {username,
              <<"alicE_marker_after_timestamp_for_threadid_can_be_fetched_2649">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,
             <<"alice_marker_after_timestamp_for_threadid_can_be_fetched_2649">>},
           {server,<<"localhost">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,
             <<"alicE_marker_after_timestamp_for_threadid_can_be_fetched_2649">>},
           {server,<<"localhost">>},
           {password,<<"matygrysa">>},
           {stream_id,<<"a8990060dad1f70a">>}]},
        5000],
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {smart_markers_SUITE,
       '-marker_after_timestamp_for_threadid_can_be_fetched/1-fun-0-',2,
       [{file,...

Report log

smart_markers_SUITE:regular:one2one:remove_markers_when_removed_user
{error,
  {{timeout,true,
     [{times,1,
        {error,
          {badrpc,timeout},
          [{distributed_helper,rpc,
             [#{node => mongooseim@localhost},
            mod_smart_markers_backend,get_chat_markers,
            [<<"localhost">>,
             {jid,
               <<"alice_remove_markers_when_removed_user_2650">>,
               <<"localhost">>,<<"res1">>},
             undefined,0]],
             [{file,
              "/home/circleci/project/big_tests/tests/distributed_helper.erl"},
            {line,121}]},
           {smart_markers_SUITE,fetch_markers_for_users,2,
             [{file,
              "/home/circleci/project/big_tests/tests/smart_markers_SUITE.erl"},
            {line,326}]},
           {smart_markers_SUITE,
             '-remove_markers_when_removed_user/1-fun-0-',2,
             [{file,
              "/home/circleci/project/big_tests/tests/smart_markers_SUITE.erl"},
            {line,244}]},
           {mongoose_helper,do_wait_until,2,
             [{file,
              "/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
            {line,374}]},
           {smart_markers_SUITE,
             '-remove_markers_when_removed_user/1-fun-2-',2,
             [{file,
              "/home/circleci/project/big_tests/tests/smart_markers_SUITE.erl"},
            {line,244}]},
           {escalus_story,story,4,
             [{file,
              "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
     ...

Report log

service_domain_db_SUITE:db:db_event_could_appear_with_lower_id
{error,
  {{badmatch,906},
   [{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,712}]},
    {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 / d0ead02
Reports root/ big
OK: 4044 / Failed: 0 / User-skipped: 89 / Auto-skipped: 0

@codecov
Copy link

codecov bot commented Dec 15, 2022

Codecov Report

Base: 71.57% // Head: 73.16% // Increases project coverage by +1.59% 🎉

Coverage data is based on head (d0ead02) compared to base (22ebb0b).
Patch coverage: 94.22% of modified lines in pull request are covered.

Additional details and impacted files
@@                   Coverage Diff                    @@
##           feature/mongoose_c2s    #3904      +/-   ##
========================================================
+ Coverage                 71.57%   73.16%   +1.59%     
========================================================
  Files                       540      540              
  Lines                     34195    34110      -85     
========================================================
+ Hits                      24475    24957     +482     
+ Misses                     9720     9153     -567     
Impacted Files Coverage Δ
src/admin_extra/service_admin_extra_accounts.erl 90.00% <ø> (ø)
src/ejabberd_app.erl 93.75% <ø> (-0.08%) ⬇️
src/gen_hook.erl 86.90% <ø> (ø)
...phql/admin/mongoose_graphql_metric_admin_query.erl 95.00% <ø> (ø)
src/graphql/mongoose_graphql_handler.erl 95.60% <ø> (ø)
...ql/user/mongoose_graphql_private_user_mutation.erl 66.66% <0.00%> (-33.34%) ⬇️
...aphql/user/mongoose_graphql_private_user_query.erl 66.66% <0.00%> (ø)
src/inbox/mod_inbox.erl 83.71% <ø> (ø)
src/inbox/mod_inbox_backend.erl 93.75% <ø> (ø)
src/inbox/mod_inbox_rdbms_async.erl 72.05% <ø> (-1.48%) ⬇️
... and 70 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.

Copy link
Member

@pawlooss1 pawlooss1 left a comment

Choose a reason for hiding this comment

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

LGTM 👌

@pawlooss1 pawlooss1 merged commit 8756003 into feature/mongoose_c2s Dec 16, 2022
@pawlooss1 pawlooss1 deleted the c2s/merge_master branch December 16, 2022 10:31
@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.

8 participants