-
Notifications
You must be signed in to change notification settings - Fork 438
[GraphQL] Fix GraphQL resolver crash when host type is not found in @use directive #4608
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
base: master
Are you sure you want to change the base?
Conversation
…to prevent crashes
This comment was marked as outdated.
This comment was marked as outdated.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4608 +/- ##
=======================================
Coverage 86.06% 86.06%
=======================================
Files 563 563
Lines 33732 33739 +7
=======================================
+ Hits 29031 29039 +8
+ Misses 4701 4700 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This comment was marked as outdated.
This comment was marked as outdated.
…for missing host type
This comment was marked as outdated.
This comment was marked as outdated.
… and improve error handling
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
elasticsearch_and_cassandra_28 / elasticsearch_and_cassandra_mnesia / bc791c3 small_tests_27 / small_tests / bc791c3 small_tests_28 / small_tests / bc791c3 small_tests_28_arm64 / small_tests / bc791c3 ldap_mnesia_27 / ldap_mnesia / bc791c3 ldap_mnesia_28 / ldap_mnesia / bc791c3 dynamic_domains_mysql_redis_28 / mysql_redis / bc791c3 internal_mnesia_28 / internal_mnesia / bc791c3 dynamic_domains_pgsql_mnesia_28 / pgsql_mnesia / bc791c3 pgsql_cets_28 / pgsql_cets / bc791c3 mysql_redis_28 / mysql_redis / bc791c3 cockroachdb_cets_28 / cockroachdb_cets / bc791c3 pubsub_SUITE:dag+collection_config:disable_persist_items_leaf_test{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alice_disable_persist_items_leaf_test_3663@localhost/res1">>,
escalus_tcp,<0.115726.0>,
[{event_manager,<0.115706.0>},
{server,<<"localhost">>},
{username,<<"alicE_disable_persist_items_leaf_test_3663">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.115706.0>},
{server,<<"localhost">>},
{username,
<<"alicE_disable_persist_items_leaf_test_3663">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"alice_disable_persist_items_leaf_test_3663">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,fun escalus_auth:auth_plain/2},
{wspath,undefined},
{username,<<"alicE_disable_persist_items_leaf_test_3663">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"90721dab04148d98">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,444}]},
{pubsub_tools,receive_and_check_response,4,
[{file,"/home/circleci/project/big_tests/tests/pubsub...pubsub_SUITE:dag+last_item_cache:send_last_published_item_no_items_test{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alice_send_last_published_item_no_items_test_3675@localhost/res1">>,
escalus_tcp,<0.115976.0>,
[{event_manager,<0.115974.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3675">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.115974.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3675">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,
<<"alice_send_last_published_item_no_items_test_3675">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,fun escalus_auth:auth_plain/2},
{wspath,undefined},
{username,
<<"alicE_send_last_published_item_no_items_test_3675">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"5003d1f308298ee6">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,444}]},
{pubsub_tools,receive_and_c...pubsub_SUITE:dag+last_item_cache:send_last_published_item_no_items_test{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alice_send_last_published_item_no_items_test_3678@localhost/res1">>,
escalus_tcp,<0.116053.0>,
[{event_manager,<0.116051.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3678">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.116051.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3678">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,
<<"alice_send_last_published_item_no_items_test_3678">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,fun escalus_auth:auth_plain/2},
{wspath,undefined},
{username,
<<"alicE_send_last_published_item_no_items_test_3678">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"84e051fdf2ab8d74">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,444}]},
{pubsub_tools,receive_and_c...pubsub_SUITE:tree+last_item_cache:send_last_published_item_no_items_test{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alice_send_last_published_item_no_items_test_3734@localhost/res1">>,
escalus_tcp,<0.117338.0>,
[{event_manager,<0.117335.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3734">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.117335.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3734">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,
<<"alice_send_last_published_item_no_items_test_3734">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,fun escalus_auth:auth_plain/2},
{wspath,undefined},
{username,
<<"alicE_send_last_published_item_no_items_test_3734">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"cef5c63c9b8b0eaa">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,444}]},
{pubsub_tools,receive_and_c...pgsql_mnesia_28 / pgsql_mnesia / bc791c3 pep_SUITE:pep_tests:native_bookmarks_test{error,{{badmatch,false},
[{pubsub_tools,check_response,2,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,455}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,445}]},
{pubsub_tools,receive_and_check_response,4,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,435}]},
{pep_SUITE,native_bookmarks_story,2,
[{file,"/home/circleci/project/big_tests/tests/pep_SUITE.erl"},
{line,223}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,75}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1796}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1305}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1237}]}]}}dynamic_domains_pgsql_mnesia_27 / pgsql_mnesia / bc791c3 last_SUITE:valid_queries:last_offline_user{error,
{test_case_failed,
{has_stanzas_but_shouldnt,
{client,<<"[email protected]/res1">>,
escalus_tcp,<0.142010.0>,
[{event_manager,<0.142009.0>},
{server,<<"domain.example.com">>},
{username,<<"alicE_unnamed_5948">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.142009.0>},
{server,<<"domain.example.com">>},
{username,<<"alicE_unnamed_5948">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"alice_unnamed_5948">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,fun escalus_auth:auth_plain/2},
{wspath,undefined},
{username,<<"alicE_unnamed_5948">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"db5948119cd9b55c">>}]},
[{xmlel,<<"presence">>,
#{<<"from">> =>
<<"[email protected]/res1">>,
<<"to">> =>
<<"[email protected]/res1">>,
<<"type">> => <<"unavailable">>},
[{xmlel,<<"status">>,#{},
[{xmlcdata,<<"Shutdown by reason: stream_end">>,
escaped}]}]},
{xmlel,<<"presence">>,
#{<<"from">> =>
<<"[email protected]/res1">>,
<<"to">> =>
...pgsql_mnesia_27 / pgsql_mnesia / bc791c3 dynamic_domains_pgsql_mnesia_27 / pgsql_mnesia / bc791c3 pgsql_mnesia_28 / pgsql_mnesia / bc791c3 |
Problem
The
@usedirective crashes with{badkey, mod_mam_pm}when checking ifmod_mam_pm/mod_mam_mucmodules are loaded. These are submodules ofmod_mamenabled via the parent module's pm/muc options, not standalone modules in the configuration.Solution
Added special handling in the directive to check if mod_mam is loaded with the appropriate option key, instead of using the standard module loading check. When host type cannot be determined, let the resolver run and return its appropriate error.