=== Test case: graphql_stanza_SUITE:user_get_last_messages/1 (click for source code)

=== Config value:

    [{has_mam,true},
     {watchdog,<0.19771.0>},
     {mim_data_dir,"/home/circleci/project/big_tests/tests/graphql_stanza_SUITE_data"},
     {preset,"pgsql_mnesia"},
     {tc_logfile,"/home/circleci/project/big_tests/ct_report/ct_run.test@43f5552376e6.2022-03-04_11.16.18/big_tests.tests.graphql_stanza_SUITE.logs/run.2022-03-04_11.19.16/graphql_stanza_suite.user_get_last_messages.23171.html"},
     {tc_group_properties,[{name,user_stanza_caregory},parallel]},
     {tc_group_path,[]},
     {data_dir,"/home/circleci/project/big_tests/_build/default/lib/mongoose_tests/ebin/graphql_stanza_SUITE_data/"},
     {priv_dir,"/home/circleci/project/big_tests/ct_report/ct_run.test@43f5552376e6.2022-03-04_11.16.18/big_tests.tests.graphql_stanza_SUITE.logs/run.2022-03-04_11.19.16/log_private/"},
     {{saved_modules,mongooseim@localhost,<<"localhost">>},
      #{mod_adhoc => [],mod_amp => [],mod_bosh => [],
        mod_cache_users => [{number_of_segments,5},{time_to_live,2}],
        mod_carboncopy => [],mod_commands => [],
        mod_disco => [{users_can_see_hidden_services,false}],
        mod_muc_commands => [],mod_muc_light_commands => [],
        mod_register =>
            [{access,register},
             {ip_access,[{allow,"127.0.0.0/8"},{deny,"0.0.0.0/0"}]},
             {welcome_message,{[],[]}}],
        mod_roster => [{backend,rdbms}],
        mod_sic => [],mod_stream_management => [],
        mod_vcard => [{backend,rdbms},{host,{prefix,<<"vjud.">>}}]}}]

=== Current directory is "/home/circleci/project/big_tests/ct_report/ct_run.test@43f5552376e6.2022-03-04_11.16.18"

=== Started at 2022-03-04 11:19:22


*** CT 2022-03-04 11:19:22.691 *** View log from node mongooseim@localhost when started mongooseim@localhost_924.html
*** CT 2022-03-04 11:19:22.691 *** View log from node ejabberd2@localhost when started ejabberd2@localhost_489.html

*** User 2022-03-04 11:19:22.698 ***
alicE_user_get_last_messages_732@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-04 11:19:22.699 ***
alicE_user_get_last_messages_732@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='feb41d7fd76d2812' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:19:22.699 ***
alicE_user_get_last_messages_732@localhost/res1 in
<stream:features>
	<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
	<compression xmlns='http://jabber.org/features/compress'>
		<method>zlib</method>
	</compression>
	<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
		<mechanism>SCRAM-SHA-256</mechanism>
		<mechanism>PLAIN</mechanism>
	</mechanisms>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2022-03-04 11:19:22.699 ***
alicE_user_get_last_messages_732@localhost/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGFsaWNFX3VzZXJfZ2V0X2xhc3RfbWVzc2FnZXNfNzMyAG1hdHlncnlzYQ==</auth>



*** User 2022-03-04 11:19:22.700 ***
alicE_user_get_last_messages_732@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-03-04 11:19:22.700 ***
alicE_user_get_last_messages_732@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-04 11:19:22.700 ***
alicE_user_get_last_messages_732@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='26d32da961b5ffb5' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:19:22.700 ***
alicE_user_get_last_messages_732@localhost/res1 in
<stream:features>
	<compression xmlns='http://jabber.org/features/compress'>
		<method>zlib</method>
	</compression>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2022-03-04 11:19:22.700 ***
alicE_user_get_last_messages_732@localhost/res1 out
<iq type='set' id='18edc27381abb4eafcb78b62af4438ad'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-03-04 11:19:22.701 ***
alicE_user_get_last_messages_732@localhost/res1 in
<iq id='18edc27381abb4eafcb78b62af4438ad' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>alicE_user_get_last_messages_732@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-03-04 11:19:22.701 ***
alicE_user_get_last_messages_732@localhost/res1 out
<iq type='set' id='112b4b3c2c971bcf078d712d575bfe9f'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-03-04 11:19:22.701 ***
alicE_user_get_last_messages_732@localhost/res1 in
<iq type='result' id='112b4b3c2c971bcf078d712d575bfe9f'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-03-04 11:19:22.701 ***
alicE_user_get_last_messages_732@localhost/res1 out
<presence/>



*** User 2022-03-04 11:19:22.704 ***
alicE_user_get_last_messages_732@localhost/res1 in
<presence from='alicE_user_get_last_messages_732@localhost/res1' to='alice_user_get_last_messages_732@localhost/res1' xml:lang='en'/>



*** User 2022-03-04 11:19:22.704 ***
bOb_user_get_last_messages_732@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-04 11:19:22.705 ***
bOb_user_get_last_messages_732@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='16e30aa34dacf6b7' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:19:22.705 ***
bOb_user_get_last_messages_732@localhost/res1 in
<stream:features>
	<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
	<compression xmlns='http://jabber.org/features/compress'>
		<method>zlib</method>
	</compression>
	<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
		<mechanism>SCRAM-SHA-256</mechanism>
		<mechanism>PLAIN</mechanism>
	</mechanisms>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2022-03-04 11:19:22.705 ***
bOb_user_get_last_messages_732@localhost/res1 out
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGJPYl91c2VyX2dldF9sYXN0X21lc3NhZ2VzXzczMgBtYWtyb2xpa2E=</auth>



*** User 2022-03-04 11:19:22.706 ***
bOb_user_get_last_messages_732@localhost/res1 in
<success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>



*** User 2022-03-04 11:19:22.706 ***
bOb_user_get_last_messages_732@localhost/res1 out
<stream:stream to='localhost' version='1.0' xml:lang='en' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams'>

*** User 2022-03-04 11:19:22.706 ***
bOb_user_get_last_messages_732@localhost/res1 in
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='2c9ada2af1e506e3' from='localhost' version='1.0' xml:lang='en'>

*** User 2022-03-04 11:19:22.706 ***
bOb_user_get_last_messages_732@localhost/res1 in
<stream:features>
	<compression xmlns='http://jabber.org/features/compress'>
		<method>zlib</method>
	</compression>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
	<register xmlns='http://jabber.org/features/iq-register'/>
	<amp xmlns='http://jabber.org/feature/amp'/>
	<sm xmlns='urn:xmpp:sm:3'/>
</stream:features>



*** User 2022-03-04 11:19:22.706 ***
bOb_user_get_last_messages_732@localhost/res1 out
<iq type='set' id='c6a79008f3fdb84c88457f57b8bce406'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<resource>res1</resource>
	</bind>
</iq>



*** User 2022-03-04 11:19:22.707 ***
bOb_user_get_last_messages_732@localhost/res1 in
<iq id='c6a79008f3fdb84c88457f57b8bce406' type='result'>
	<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
		<jid>bOb_user_get_last_messages_732@localhost/res1</jid>
	</bind>
</iq>



*** User 2022-03-04 11:19:22.707 ***
bOb_user_get_last_messages_732@localhost/res1 out
<iq type='set' id='ee2a57861d9e0f949107ed190d4a603e'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-03-04 11:19:22.707 ***
bOb_user_get_last_messages_732@localhost/res1 in
<iq type='result' id='ee2a57861d9e0f949107ed190d4a603e'>
	<session xmlns='urn:ietf:params:xml:ns:xmpp-session'/>
</iq>



*** User 2022-03-04 11:19:22.707 ***
bOb_user_get_last_messages_732@localhost/res1 out
<presence/>



*** User 2022-03-04 11:19:22.710 ***
bOb_user_get_last_messages_732@localhost/res1 in
<presence from='bOb_user_get_last_messages_732@localhost/res1' to='bob_user_get_last_messages_732@localhost/res1' xml:lang='en'/>



*** User 2022-03-04 11:19:22.716 ***
REST request:
Code: 200
Req: {<0.19886.0>,<<"/api/graphql">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"07409f2b50a16607">>},
       {<<"authorization">>,
        <<"Basic YWxpY2VfdXNlcl9nZXRfbGFzdF9tZXNzYWdlc183MzJAbG9jYWxob3N0Om1hdHlncnlzYQ==">>}],
      <<"{\"variables\":{\"to\":\"bOb_user_get_last_messages_732@localhost\",\"from\":\"alicE_user_get_last_messages_732@localhost/res1\",\"body\":\"Hi!\"},\"query\":\"mutation M1($from: JID, $to: JID!, $body: String!) { stanza { sendMessage(from: $from, to: $to, body: $body) { id } } }\",\"operationName\":\"M1\"}">>}
Result: {{<<"200">>,<<"OK">>},
         [{<<"vary">>,<<"accept">>},
          {<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Fri, 04 Mar 2022 11:19:22 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"57">>}],
         <<"{\"data\":{\"stanza\":{\"sendMessage\":{\"id\":\"BMB2LV4484O1\"}}}}">>,
         195,4974}
Params: #{body =>
              <<"{\"variables\":{\"to\":\"bOb_user_get_last_messages_732@localhost\",\"from\":\"alicE_user_get_last_messages_732@localhost/res1\",\"body\":\"Hi!\"},\"query\":\"mutation M1($from: JID, $to: JID!, $body: String!) { stanza { sendMessage(from: $from, to: $to, body: $body) { id } } }\",\"operationName\":\"M1\"}">>,
          creds =>
              {<<"alice_user_get_last_messages_732@localhost">>,
               <<"matygrysa">>},
          method => <<"POST">>,path => <<"/api/graphql">>,port => 5561,
          return_headers => true,return_maps => true,
          role => {graphql,<<"user">>},
          server => #{node => mongooseim@localhost}}


*** User 2022-03-04 11:19:22.716 ***
bOb_user_get_last_messages_732@localhost/res1 in
<message from='alicE_user_get_last_messages_732@localhost/res1' to='bOb_user_get_last_messages_732@localhost' type='chat' id='040e2e789781d4a8'>
	<body>Hi!</body>
	<stanza-id by='bOb_user_get_last_messages_732@localhost' id='BMB2LV4484O1' xmlns='urn:xmpp:sid:0'/>
</message>



*** User 2022-03-04 11:19:24.761 ***
REST request:
Code: 200
Req: {<0.19936.0>,<<"/api/graphql">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"6af297329e5ec5ab">>},
       {<<"authorization">>,
        <<"Basic YWxpY2VfdXNlcl9nZXRfbGFzdF9tZXNzYWdlc183MzJAbG9jYWxob3N0Om1hdHlncnlzYQ==">>}],
      <<"{\"variables\":{\"caller\":\"alicE_user_get_last_messages_732@localhost/res1\"},\"query\":\"query Q1($with: JID, $limit: Int, $before: DateTime) { stanza { getLastMessages(with: $with, limit: $limit, before: $before) { stanzas { stanza_id stanza sender timestamp } limit } } }\",\"operationName\":\"Q1\"}">>}
Result: {{<<"200">>,<<"OK">>},
         [{<<"vary">>,<<"accept">>},
          {<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Fri, 04 Mar 2022 11:19:24 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"376">>}],
         <<"{\"data\":{\"stanza\":{\"getLastMessages\":{\"stanzas\":[{\"timestamp\":\"2022-03-04T11:19:22.712436Z\",\"stanza_id\":\"BMB2LV442T01\",\"stanza\":\"Hi!\",\"sender\":\"alice_user_get_last_messages_732@localhost/res1\"}],\"limit\":50}}}}">>,
         515,2454}
Params: #{body =>
              <<"{\"variables\":{\"caller\":\"alicE_user_get_last_messages_732@localhost/res1\"},\"query\":\"query Q1($with: JID, $limit: Int, $before: DateTime) { stanza { getLastMessages(with: $with, limit: $limit, before: $before) { stanzas { stanza_id stanza sender timestamp } limit } } }\",\"operationName\":\"Q1\"}">>,
          creds =>
              {<<"alice_user_get_last_messages_732@localhost">>,
               <<"matygrysa">>},
          method => <<"POST">>,path => <<"/api/graphql">>,port => 5561,
          return_headers => true,return_maps => true,
          role => {graphql,<<"user">>},
          server => #{node => mongooseim@localhost}}


*** User 2022-03-04 11:19:24.766 ***
REST request:
Code: 200
Req: {<0.19938.0>,<<"/api/graphql">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"394be36585976343">>},
       {<<"authorization">>,
        <<"Basic YWxpY2VfdXNlcl9nZXRfbGFzdF9tZXNzYWdlc183MzJAbG9jYWxob3N0Om1hdHlncnlzYQ==">>}],
      <<"{\"variables\":{\"caller\":\"bOb_user_get_last_messages_732@localhost/res1\"},\"query\":\"query Q1($with: JID, $limit: Int, $before: DateTime) { stanza { getLastMessages(with: $with, limit: $limit, before: $before) { stanzas { stanza_id stanza sender timestamp } limit } } }\",\"operationName\":\"Q1\"}">>}
Result: {{<<"200">>,<<"OK">>},
         [{<<"vary">>,<<"accept">>},
          {<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Fri, 04 Mar 2022 11:19:24 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"376">>}],
         <<"{\"data\":{\"stanza\":{\"getLastMessages\":{\"stanzas\":[{\"timestamp\":\"2022-03-04T11:19:22.712436Z\",\"stanza_id\":\"BMB2LV442T01\",\"stanza\":\"Hi!\",\"sender\":\"alice_user_get_last_messages_732@localhost/res1\"}],\"limit\":50}}}}">>,
         515,2649}
Params: #{body =>
              <<"{\"variables\":{\"caller\":\"bOb_user_get_last_messages_732@localhost/res1\"},\"query\":\"query Q1($with: JID, $limit: Int, $before: DateTime) { stanza { getLastMessages(with: $with, limit: $limit, before: $before) { stanzas { stanza_id stanza sender timestamp } limit } } }\",\"operationName\":\"Q1\"}">>,
          creds =>
              {<<"alice_user_get_last_messages_732@localhost">>,
               <<"matygrysa">>},
          method => <<"POST">>,path => <<"/api/graphql">>,port => 5561,
          return_headers => true,return_maps => true,
          role => {graphql,<<"user">>},
          server => #{node => mongooseim@localhost}}


*** User 2022-03-04 11:19:24.766 ***
bOb_user_get_last_messages_732@localhost/res1 out
</stream:stream>

*** User 2022-03-04 11:19:24.767 ***
bOb_user_get_last_messages_732@localhost/res1 in
</stream:stream>

*** User 2022-03-04 11:19:24.767 ***
alicE_user_get_last_messages_732@localhost/res1 out
</stream:stream>

*** User 2022-03-04 11:19:24.767 ***
alicE_user_get_last_messages_732@localhost/res1 in
</stream:stream>
*** CT 2022-03-04 11:19:24.769 *** View log from node ejabberd2@localhost when finished ejabberd2@localhost_489.html
*** CT 2022-03-04 11:19:24.770 *** View log from node mongooseim@localhost when finished mongooseim@localhost_926.html



=== Ended at 2022-03-04 11:19:24
=== successfully completed test case
=== === Returned value: ok