-
Notifications
You must be signed in to change notification settings - Fork 428
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
Fix 3 issues in SM resumption #2049
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the TODO list :) Also I had one question to the code.
@@ -2536,7 +2540,8 @@ resend_subscription_requests(Acc, #state{pending_invitations = Pending} = StateD | |||
A1 = send_element(A, XMLPacket, State), | |||
{value, From} = xml:get_tag_attr(<<"from">>, XMLPacket), | |||
{value, To} = xml:get_tag_attr(<<"to">>, XMLPacket), | |||
BufferedStateData = buffer_out_stanza({From, To, XMLPacket}, State), | |||
PacketTuple = {jid:from_binary(From), jid:from_binary(To), XMLPacket}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have from
and to
in the Acc at this point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at the lines above - they are retrieved directly from xmlel
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Maybe this question would be better. Are the from and to attributes the same in the stanza and in the Account?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, however this code seems to be correct as it is covered with tests. I'll add this item to TODO list. :)
36ebe3e
to
f51a925
Compare
f51a925
to
5aca772
Compare
6264.1 / Erlang 19.3 / small_tests / 9c05df1 6264.5 / Erlang 19.3 / ldap_mnesia / 9c05df1 6264.6 / Erlang 19.3 / elasticsearch_and_cassandra_mnesia / 9c05df1 6264.3 / Erlang 19.3 / mysql_redis / 9c05df1 pubsub_SUITE:tree+hometree_specific:can_create_node_with_existing_parent_path{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,<<"alicE87.960954@localhost/res1">>,escalus_tcp,
<0.11555.3>,
[{event_manager,<0.11542.3>},
{server,<<"localhost">>},
{username,<<"alicE87.960954">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.11542.3>},
{server,<<"localhost">>},
{username,<<"alicE87.960954">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"alicE87.960954">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"alicE87.960954">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"AC03FDB4B3D6D647">>}]},
5000],
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,138}]},
{pubsub_tools,receive_response,3,
[{file,"pubsub_tools.erl"},{line,456}]},
{pubsub_tools,receive_and_check_response,4,
[{file,"pubsub_tools.erl"},{line,447}]},
{pubsub_SUITE,'-can_create_node_with_existing_parent_path/1-fun-0-',
1,
[{file,"pubsub_SUITE.erl"},{line,1767}]},
{escalus_story,story,4,
[{file,
"/home/travis/build/esl/MongooseIM/... 6264.2 / Erlang 19.3 / internal_mnesia / 9c05df1 6264.4 / Erlang 19.3 / odbc_mssql_mnesia / 9c05df1 mod_global_distrib_SUITE:mod_global_distrib:test_pm_with_ungraceful_reconnection_to_different_server{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,<<"eve98.481058@localhost/res1">>,escalus_tcp,
<0.22179.3>,
[{event_manager,<0.22170.3>},
{server,<<"localhost">>},
{username,<<"eve98.481058">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.22170.3>},
{server,<<"localhost">>},
{username,<<"eve98.481058">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"eve98.481058">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"eve98.481058">>},
{server,<<"localhost">>},
{password,<<"password">>},
{port,5222},
{stream_management,true},
{stream_id,<<"FC349A65B5F92052">>}]},
10000],
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,138}]},
{mod_global_distrib_SUITE,
'-test_pm_with_ungraceful_reconnection_to_different_server/1-fun-0-',
4,
[{file,"mod_global_distrib_SUITE.erl"},{line,610}]},
{escalus_story,story,4,
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
... mod_global_distrib_SUITE:mod_global_distrib:test_pm_with_ungraceful_reconnection_to_different_server{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,<<"eve51.906236@localhost/res1">>,escalus_tcp,
<0.23015.3>,
[{event_manager,<0.23006.3>},
{server,<<"localhost">>},
{username,<<"eve51.906236">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.23006.3>},
{server,<<"localhost">>},
{username,<<"eve51.906236">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"eve51.906236">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"eve51.906236">>},
{server,<<"localhost">>},
{password,<<"password">>},
{port,5222},
{stream_management,true},
{stream_id,<<"8B2724D2368F383C">>}]},
10000],
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,138}]},
{mod_global_distrib_SUITE,
'-test_pm_with_ungraceful_reconnection_to_different_server/1-fun-0-',
4,
[{file,"mod_global_distrib_SUITE.erl"},{line,610}]},
{escalus_story,story,4,
[{file,
"/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
... 6264.8 / Erlang 20.0 / pgsql_mnesia / 9c05df1 6264.9 / Erlang 21.0 / riak_mnesia / 9c05df1 6264.4 / Erlang 19.3 / odbc_mssql_mnesia / 9c05df1 |
Codecov Report
@@ Coverage Diff @@
## master #2049 +/- ##
==========================================
+ Coverage 78.77% 78.79% +0.01%
==========================================
Files 333 333
Lines 28788 28793 +5
==========================================
+ Hits 22679 22688 +9
+ Misses 6109 6105 -4
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This PR addresses #2020
Function responsible for gathering incoming messages was returning them in wrong format (returned tuples had wrong elements).
Subscription requests were resent with
From
andTo
as binaries, not JID record, leading to an error.If a session sends a request and the reply is received by a new process (the resumed one), there is a SID mismatch. In order to deal with it, new C2S remembers old SID to use it for conflict check.
TODO:
from
andto
may be retrieved from Acc inejabberd_c2s:resend_subscription_requests
Blocked until #2054 is merged, because it relies on module injection helper.