Process-one
ejabberd
ejabberd@conference.process-one.net
Thursday, February 15, 2018< ^ >
zinid has set the subject to: ejabberd discussions: https://docs.ejabberd.im
Room Configuration
Room Occupants

GMT+0
[00:00:19] pinky leaves the room: Stream reset by peer
[00:05:07] ata2001 leaves the room: Disconnected: Replaced by new connection
[00:06:10] joekokker leaves the room
[00:06:50] marc leaves the room: unknown reason
[00:10:20] SouL leaves the room
[00:16:24] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[00:19:06] debalance leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[00:20:42] jere leaves the room
[00:26:02] uio leaves the room: Stream closed by us: Replaced by new connection (conflict)
[00:26:15] jere leaves the room
[00:27:46] SouL leaves the room
[00:29:18] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[00:41:30] ata2001 leaves the room
[00:42:01] vanitasvitae leaves the room
[00:44:05] SouL leaves the room
[00:49:12] rom1dep leaves the room: Stream closed by us: Replaced by new connection (conflict)
[00:49:42] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[00:59:11] SouL leaves the room
[01:01:55] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[01:04:14] jere leaves the room
[01:04:40] Licaon_Kter leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[01:10:08] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[01:10:53] pod leaves the room
[01:12:11] Mathias F. Popp leaves the room
[01:14:51] SouL leaves the room
[01:22:00] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[01:28:59] jere leaves the room
[01:29:55] SouL leaves the room
[01:36:17] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[01:45:03] SouL leaves the room
[01:48:25] pztrn leaves the room: Connection failed: connection closed
[02:00:56] SouL leaves the room
[02:14:52] SouL leaves the room
[02:18:44] andrey.g leaves the room
[02:29:13] jere leaves the room
[02:30:08] SouL leaves the room
[02:40:45] carlos leaves the room
[02:45:09] SouL leaves the room
[03:00:57] SouL leaves the room
[03:16:58] SouL leaves the room
[03:32:58] SouL leaves the room
[03:42:33] pod leaves the room
[03:45:01] SouL leaves the room
[03:53:36] vanitasvitae leaves the room: Connection failed: connection closed
[03:57:20] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[04:00:01] SouL leaves the room
[04:17:01] SouL leaves the room
[04:30:03] SouL leaves the room
[04:44:52] SouL leaves the room
[05:00:02] SouL leaves the room
[05:09:58] rom1dep leaves the room: Stream closed by us: Replaced by new connection (conflict)
[05:13:35] jeremy leaves the room: Stream closed by us: Replaced by new connection (conflict)
[05:15:18] SouL leaves the room
[05:30:08] SouL leaves the room
[05:30:32] zinid leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[05:46:06] SouL leaves the room
[06:01:21] SouL leaves the room
[06:16:05] SouL leaves the room
[06:32:58] Holger leaves the room: Replaced by new connection
[06:33:37] SouL leaves the room
[06:44:51] SouL leaves the room
[06:50:48] marc leaves the room: unknown reason
[06:54:54] srgcdev leaves the room
[06:56:17] debalance leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[07:00:37] SouL leaves the room
[07:14:50] pod leaves the room
[07:14:52] SouL leaves the room
[07:15:06] <zinid> Holger, is send_rack required after all message being sent?
[07:15:17] <zinid> *after every
[07:15:56] <Holger> zinid: Not required, but I thought it's a good idea.
[07:16:14] <zinid> if it's not required, then I have a patch
[07:16:59] <zinid> https://gist.github.com/zinid/58b221fe773b9e433115b41c6d918bda
[07:17:03] <Holger> zinid: An <r/> is already suppressed if we're waiting for a previous ACK.
[07:17:47] <zinid> if we require <r/> then the patch will be even more obscure
[07:19:04] <zinid> Holger, the idea is to put an error stanza in the queue when bad xml is detected during receive phase
[07:21:53] <Holger> This is about bad XML only?
[07:22:16] <Holger> Don't we close the connection with a steam error in that case?
[07:22:28] <Holger> stream error even.
[07:23:44] <zinid> Yes, this is for bad xml only
[07:23:57] <zinid> and no, we don't
[07:24:04] <Holger> Ah ok.
[07:24:16] <Holger> Anyway yes this should be fine.
[07:24:16] <zinid> not sure if closing is a great idea
[07:24:40] <zinid> Holger, ok, I commit, if we have better idea we will improve this
[07:24:53] <Holger> Ok, thanks.
[07:25:03] <Holger> Was this the Psi issue?
[07:25:38] <zinid> yes
[07:25:49] <zinid> so this was our bug after all, hehe
[07:27:08] <zinid> mod_stream_mgmt already has so many ugliness...
[07:28:52] <Holger> Damn, lost my bet then.
[07:29:00] <Holger> Yes it has.
[07:29:44] <Holger> zinid: Is your internet back?
[07:30:02] SouL leaves the room
[07:30:16] <zinid> Holger, yep
[07:30:31] <Holger> Yay.
[07:30:47] rom1dep leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[07:31:39] ChaosKid42 leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[07:46:24] SouL leaves the room
[07:48:13] rom1dep leaves the room: Stream closed by us: Replaced by new connection (conflict)
[07:52:26] debalance leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[08:01:27] SouL leaves the room
[08:02:24] Man_Life leaves the room
[08:05:20] pod leaves the room
[08:17:13] SouL leaves the room
[08:21:41] <zinid> ok, I improved a fix a bit (without copy-pasting code from xmpp_stream_in.erl)
[08:21:47] <zinid> *the fix
[08:22:12] <zinid> and racks are now sent
[08:25:14] frainz leaves the room: Stream closed by us: Replaced by new connection (conflict)
[08:32:20] uio leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[08:32:25] SouL leaves the room
[08:47:04] SouL leaves the room
[08:49:36] joekokker leaves the room
[08:51:36] <zinid> !version conversations.im
[08:51:37] <Servant> zinid: conversations.im is running ejabberd version 18.01.29-conversations.im on unix/linux 4.9.0
[08:51:51] <zinid> ok, the "id" fix works now 😉
[09:02:29] SouL leaves the room
[09:18:40] Licaon_Kter leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[09:18:50] SouL leaves the room
[09:22:32] mimi89999 leaves the room
[09:31:31] SouL leaves the room
[09:41:38] zuglufttier leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[09:43:59] SaltyBones leaves the room: Machine going to sleep
[09:46:24] SouL leaves the room
[09:49:47] zuglufttier leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[09:50:47] SaltyBones leaves the room: Connection failed: ping_timeout
[09:57:19] Man_Life leaves the room: Logged out
[10:01:31] joekokker leaves the room
[10:02:44] SouL leaves the room
[10:16:45] SouL leaves the room
[10:20:41] debalance leaves the room
[10:28:18] pod leaves the room
[10:34:54] SouL leaves the room
[10:41:00] ileh leaves the room
[10:46:56] SouL leaves the room
[10:49:15] cippaciong leaves the room
[10:50:40] Man_Life leaves the room: Replaced by new connection
[10:53:38] cippaciong leaves the room
[11:02:15] SouL leaves the room
[11:10:30] jere leaves the room
[11:15:06] <Holger> zinid: As usual, I don't get it, sorry.  Where is this error stanza you're fighting with generated?
[11:16:08] <Holger> I'm totally confused by the current version of the code :-(
[11:17:05] SouL leaves the room
[11:18:23] Man_Life leaves the room
[11:27:20] <zinid> https://github.com/processone/ejabberd/blob/master/src/xmpp_stream_in.erl#L357
[11:29:04] <zinid> so we have a callback: https://github.com/processone/ejabberd/blob/master/src/xmpp_stream_in.erl#L358
we set mgmt_is_resent := false in this callback and will check for its presence in handle_send
[11:30:44] <zinid> without the fix, this packet is not queued: https://github.com/processone/ejabberd/blob/master/src/xmpp_stream_in.erl#L443
[11:32:48] SouL leaves the room
[11:37:32] SaltyBones leaves the room: Machine going to sleep
[11:37:59] Student leaves the room
[11:39:11] <Holger> Ahh process_invalid_xml() is what I overlooked, dammit.  Thank you.
[11:40:44] <Holger> Wow this is ugly.
[11:46:23] <zinid> modularity
[11:47:53] <Holger> But the only problem with the original code was that ?is_stanza didn't match the raw xmlel(), or what am I overlooking?
[11:48:06] SouL leaves the room
[11:48:45] <Holger> Can't we fix the matching in c2s_handle_send without having to flag the error stanza earlier in the code?
[11:50:12] <zinid> how will you attach meta to raw xml?
[11:50:28] <zinid> if you don't attach, then how will you know it's a resent?
[11:50:44] <Holger> Ah.
[11:50:58] <zinid> obviously I understand the problem 😉
[11:51:31] <Holger> Yes no doubt.  I was just asking to understand the other side of the problem myself.
[11:51:38] <zinid> ah, ok
[11:56:24] rom1dep leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[11:58:03] <marc> zinid, can you give me a hint how I  can subscribe two local users?
[11:58:22] <marc> I tried mod_roster:out_subscription() and mod_roster:in_subscription()
[11:58:37] <zinid> ah
[11:58:46] <zinid> dunno, probably you cannot
[11:59:00] <marc> Because... ?
[11:59:28] <zinid> because it was needed?
[11:59:34] <zinid> *was not
[11:59:54] Student leaves the room
[11:59:55] <marc> Okay, but there must be some code somewhere
[12:00:19] <zinid> yes, for example set_roster
[12:00:23] frainz leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[12:00:27] <zinid> but this will not generate pushes
[12:00:50] <marc> Okay, set_roster() is fine for now
[12:01:02] <marc> Yeah, roster push comes later
[12:01:22] SouL leaves the room
[12:03:34] SaltyBones leaves the room: Machine going to sleep
[12:04:14] <zinid> you can use push_item() in order to generate pushes
[12:05:52] <zinid> probably set_roster() can do that automatically, hum
[12:05:52] <Holger> zinid: And we don't want to xmpp:decode the error stanza in xmpp_stream_in:send_error()?
[12:06:18] <zinid> Holger, why we need to decode there?
[12:06:38] <zinid> also, what's the point to decode a stanza for which decoding has already failed? 😉
[12:07:06] <Holger> Oh our error stanza won't decode successfully?
[12:07:23] <zinid> no, because it's malformed stanza with our error element attached
[12:07:41] <zinid> so we let the sender to parse this shit now 🙂
[12:08:28] <Holger> Hmm.
[12:08:51] <zinid> https://github.com/processone/xmpp/blob/master/src/xmpp.erl#L150
[12:08:58] <zinid> here what happens with such stanza
[12:09:10] <Holger> Yup.
[12:09:16] <zinid> Els ++ [encode(Err, ?NS_CLIENT)]
[12:09:38] <Student> !version xmpp.jp
[12:09:39] <Holger> Well I just feel the real problem is that hook subscribers have to be prepared to deal with raw xmlel() ...
[12:10:03] <zinid> Holger, but how to fix this?
[12:10:03] <Holger> But I have no obvious solution.  Tack meta onto xmlel() :-)
[12:10:34] <zinid> yes, this is the best solution (among all ugly ones) but xmlel() are already stored in some database tables
[12:10:46] <zinid> so you need to write a converter
[12:10:52] <zinid> of course you can go this route 😀
[12:10:58] <Holger> 'xmlel++'()
[12:11:04] <Holger> Sorry :-)
[12:11:09] <Holger> I'm giving up.
[12:11:32] <zinid> yeah, I don't think because of a single ugly place we need to go through all this
[12:12:13] <Holger> Yes, if this doesn't bite us elsewhere it's ok.
[12:12:40] <zinid> I don't think so, this xmlel() crap is pretty much isolated
[12:12:48] <zinid> it's just mod_stream_mgmt does low-level shit
[12:14:53] marc leaves the room
[12:15:12] <zinid> actually here comes yet another fundamental problem of xmpp: do we count <iq/> as stanza?
[12:15:21] <zinid> I mean without id and type
[12:15:39] <Holger> Hah.
[12:15:43] <Holger> Good question!
[12:16:19] <zinid> that's why I'm a big fan of transport-level encoding
[12:16:22] SouL leaves the room
[12:18:50] <Holger> So in this case that you fixed now, our *incoming* stanza count will probably be out of sync with the client's count.
[12:19:33] <zinid> really?
[12:19:54] <zinid> where do we increment incoming stanza count?
[12:19:54] <Holger> The client sent an invalid <iq/> and the client's stream management code probably counted it as an outgoing stanza.  We won't count it as an incoming one though.
[12:20:20] <Holger> c2s_authenticated_packet
[12:20:38] <zinid> ah, shit
[12:20:56] <Holger> Well I don't know whether we really have to handle invalid stanzas correctly.
[12:21:02] <Holger> Good question for the XSF.
[12:21:28] <Holger> I mean I don't know whether it's correct 0198 behavior to count invalid stanzas.
[12:22:45] <zinid> can't we just call update_num_stanzas_in() in c2s_handle_recv?
[12:23:29] <marc> zinid, what's OldItem in my case? I have some code for pushes but it seems out-dated
[12:23:59] <zinid> marc, you should construct it as an item with subscription=none
[12:24:18] <zinid> with the same other fields (from NewItem)
[12:24:39] <zinid> OldItem = NewItem#roster{subscription = none}
[12:24:45] <zinid> something like that
[12:24:53] <zinid> I think this will work
[12:25:01] <marc> zinid, okay, but actually they're already subscribed. Does this matter?
[12:25:11] <zinid> yes, it matters
[12:25:26] <zinid> then just put needed subscription value in OldItem
[12:25:33] debalance leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[12:26:03] <zinid> in the case if there is already "both" I don't understand why you need pushes
[12:27:38] <marc> zinid, because the other user needs to be informed about the new subscription. otherwise the user needs to re-login to get the new roster item
[12:28:08] <zinid> I'm lost
[12:28:50] <zinid> ok, then just assume that you need subscription=none in OldItem
[12:28:55] <zinid> cannot say, check please
[12:31:53] <marc> zinid, I want mutual subscription for inviter and invitee. The subscription is done when the invitee uses the token for registration. The invitee gets the correct roster because he/she performs a roster-request during login. If the inviter is online during the registration, he/she won't get the information about the new contact without push
[12:32:01] SouL leaves the room
[12:32:06] <marc> zinid, let me know if that is not correct :)
[12:32:15] <Holger> zinid: c2s_handle_recv -- maybe.  You refactored the code :-)
[12:32:18] <Holger> zinid: I'll have a look.
[12:32:51] <zinid> Holger, it seems like we also need addition check for MgmtState value in IsStanza clause of c2s_handle_recv
[12:33:11] <zinid> *additional
[12:33:30] <zinid> I don't think we should set the flag when mgmt is inactive
[12:35:48] <Holger> Indeed.
[12:36:34] <zinid> > git diff                                                
diff --git a/src/mod_stream_mgmt.erl b/src/mod_stream_mgmt.erl
index d295053..549a15d 100644
--- a/src/mod_stream_mgmt.erl
+++ b/src/mod_stream_mgmt.erl
@@ -176,7 +176,8 @@ c2s_authenticated_packet(#{mgmt_state := MgmtState} = State, Pkt)
c2s_authenticated_packet(State, Pkt) ->
     update_num_stanzas_in(State, Pkt).

-c2s_handle_recv(#{lang := Lang} = State, El, {error, Why}) ->
+c2s_handle_recv(#{mgmt_state := MgmtState,
+                 lang := Lang} = State, El, {error, Why}) ->
     Xmlns = xmpp:get_ns(El),
     IsStanza = xmpp:is_stanza(El),
     if Xmlns == ?NS_STREAM_MGMT_2; Xmlns == ?NS_STREAM_MGMT_3 ->
@@ -185,12 +186,13 @@ c2s_handle_recv(#{lang := Lang} = State, El, {error, Why}) ->
                             text = xmpp:mk_text(Txt, Lang),
                             xmlns = Xmlns},
            send(State, Err);
-       IsStanza ->
+       IsStanza andalso (MgmtState == pending orelse MgmtState == active) ->
+           State1 = update_num_stanzas_in(State, El),
            case xmpp:get_type(El) of
-               <<"result">> -> State;
-               <<"error">> -> State;
+               <<"result">> -> State1;
+               <<"error">> -> State1;
                _ ->
-                   State#{mgmt_is_resent => false}
+                   State1#{mgmt_is_resent => false}
            end;
        true ->
            State
[12:36:42] <zinid> yeah, I know patches suck 😕
[12:37:53] <zinid> it's easier to show the result, just a second
[12:38:04] <Holger> No it's fine I see it.
[12:38:25] <zinid> https://gist.github.com/zinid/25a382ebb4261d30a40b3652d4721052
[12:40:57] <Holger> Resulting behavior is correct I think.  But uuugh!
[12:40:58] <Holger> :-)
[12:41:26] <zinid> seemed to be working, just checked with Psi
[12:43:05] <Holger> Maybe the hack would be a little more self-explanatory if you called it 'mgmt_queue_next_stanza => true' instead of 'mgmt_is_resent => false'?
[12:43:30] <zinid> commited
[12:43:38] <zinid> Holger, maybe
[12:44:09] <zinid> or probably mgmt_force_queue
[12:44:25] SaltyBones leaves the room: unknown reason
[12:44:39] <zinid> pick one, I will rename, it's important to keep this stupid code clear
[12:44:41] <Holger> Yes, even better.  I see that you're coming from the problem that you can't set 'mgmt_is_resent' for a raw xmlel().  But if you look at this mess you understand nothing, and yes 'mgmt_force_queue' would give a hint at least.
[12:44:58] <zinid> ok, I'll rename to mgmt_force_queue
[12:44:59] <Holger> mgmt_force_queue sounds good to me.
[12:45:21] debalance leaves the room
[12:45:25] <zinid> mgmt_force_enqueue 🙂
[12:45:33] <zinid> even better!
[12:45:52] <Holger> Yes!
[12:46:15] Man_Life leaves the room: Logged out
[12:46:27] jeremy leaves the room: Stream closed by us: Replaced by new connection (conflict)
[12:47:15] SouL leaves the room
[12:50:17] debalance leaves the room: Stream closed by us: Replaced by new connection (conflict)
[12:50:43] <zinid> done
[12:50:52] <zinid> Holger, thanks a lot for spotting this!
[12:51:18] <Holger> Nah thanks for fixing stuff, as usual.
[12:55:37] suzyo leaves the room
[12:57:01] ata2001 leaves the room: Disconnected: closed
[12:57:18] debalance leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[12:59:47] jere leaves the room
[13:01:43] vanitasvitae leaves the room
[13:03:29] SouL leaves the room
[13:03:54] joekokker leaves the room
[13:08:32] ChaosKid42 leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[13:16:21] SouL leaves the room
[13:22:02] srgcdev leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[13:26:07] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[13:26:26] Akasch leaves the room: Replaced by new connection
[13:26:40] mnr11 leaves the room: offline
[13:29:42] jere leaves the room
[13:34:22] SouL leaves the room
[13:47:03] SouL leaves the room
[13:53:40] Akasch leaves the room: Rechner geht in den Ruhezustand
[14:02:13] SouL leaves the room
[14:03:17] suzyo leaves the room
[14:05:50] rom1dep leaves the room: Stream closed by us: Replaced by new connection (conflict)
[14:06:32] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[14:16:05] ChaosKid42 leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[14:16:36] suzyo leaves the room
[14:18:33] SouL leaves the room
[14:22:31] cippaciong leaves the room: Stream closed by us: Replaced by new connection (conflict)
[14:27:20] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[14:29:04] Man_Life leaves the room: Logged out
[14:31:49] SouL leaves the room
[14:34:42] suzyo leaves the room
[14:35:31] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[14:36:25] Licaon_Kter leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[14:37:39] uio leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[14:45:31] SaltyBones leaves the room: Stream closed by us: Replaced by new connection (conflict)
[14:46:40] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[14:47:13] SouL leaves the room
[14:50:20] zuglufttier leaves the room
[14:50:47] jannic leaves the room
[14:51:39] zuglufttier leaves the room
[14:52:30] zuglufttier leaves the room
[14:53:30] zuglufttier leaves the room
[14:57:38] pprrks leaves the room
[15:01:20] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[15:02:42] SouL leaves the room
[15:17:16] SouL leaves the room
[15:20:26] zinid leaves the room: Stream closed by us: Replaced by new connection (conflict)
[15:21:08] <Student> !version xmpp.jp
[15:21:09] <Servant> Student: xmpp.jp is running XMPP.JP Server version 2017
[15:23:10] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[15:31:45] SouL leaves the room
[15:31:47] SaltyBones leaves the room: unknown reason
[15:42:33] jeremy leaves the room: Stream closed by us: Replaced by new connection (conflict)
[15:44:44] suzyo leaves the room
[15:45:47] hlad leaves the room
[15:47:04] SouL leaves the room
[15:49:31] jere leaves the room: Disconnected: Replaced by new connection
[15:51:20] Akasch leaves the room
[15:58:27] <zinid> seems like they are running 18.01
[16:02:06] SouL leaves the room
[16:02:27] Mathias F. Popp leaves the room
[16:13:43] joekokker leaves the room
[16:18:53] SouL leaves the room
[16:19:17] ata2001 leaves the room: Disconnected: closed
[16:21:01] frainz leaves the room: Stream closed by us: Replaced by new connection (conflict)
[16:21:04] jere leaves the room
[16:25:03] vanitasvitae leaves the room
[16:25:10] SouL leaves the room
[16:25:10] SouL leaves the room
[16:34:39] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[16:34:50] SouL leaves the room
[16:36:57] <marc> zinid, do you have an idea what's the problem here? https://paste.fedoraproject.org/paste/PrT5Ljyz-yBlRIxKbjaoug
[16:37:15] <marc> I guess it has something to do with my roster pushes but I don't understand it
[16:38:37] <marc> erlang errors are really ugly formatted...
[16:38:59] <zinid> jid:to_string?
[16:39:02] <zinid> what ejabberd version?
[16:39:36] <zinid> anyway, seems like incorrect jid in #roster_item{}
[16:39:48] <marc> master
[16:40:39] <zinid> well, jid:to_string is deprecated a long time ago
[16:40:47] <zinid> seems like you have old deps
[16:40:49] hlad leaves the room
[16:41:15] <marc> at least my code doesn't use it
[16:41:25] <marc> xmpp shouldn't be that old
[16:42:08] <zinid> "shouldn't be" is the key word 😉
[16:42:43] <marc> zinid, 27. Jan?
[16:42:51] <zinid> if you install it somewhere, then this could be a problem too, because you may end up with both old and new version installed and erlang picks it randomly depending on moon phase
[16:43:52] <marc> ah okay
[16:44:23] <zinid> yeah, so you should check, run application:which_applications() and check the version seen by Erlang
[16:44:45] <marc> zinid, in the ejabberd erlang shell?
[16:44:53] <zinid> yeah, when you start ejabberd
[16:45:04] <zinid> I think you start it in "live" mode
[16:45:05] joekokker leaves the room
[16:45:51] <marc> {xmpp,"Erlang/Elixir XMPP parsing and serialization library",
       "1.1.19"},
[16:46:01] <marc> zinid, of course I don't :D
[16:46:21] <marc> That's how my roster push looks like:
Inviter = <<"a">>,
JID = jid:make(User, Server),
Roster = #roster{us = {Inviter, Server}, jid = JID, subscription = both},
mod_roster:push_item(Inviter, Server, jid:make(Inviter, Server), Roster, Roster),
[16:47:58] <zinid> -record(roster,
{
    usj = {<<>>, <<>>, {<<>>, <<>>, <<>>}} :: {binary(), binary(), jid:ljid()} | '_',
    us = {<<>>, <<>>}                      :: {binary(), binary()} | '_',
    jid = {<<>>, <<>>, <<>>}               :: jid:ljid(),
    name = <<>>                            :: binary() | '_',
    subscription = none                    :: subscription() | '_',
    ask = none                             :: ask() | '_',
    groups = []                            :: [binary()] | '_',
    askmessage = <<"">>                    :: binary() | '_',
    xs = []                                :: [fxml:xmlel()] | '_'
}).
[16:48:09] <zinid> JID is incorrect
[16:48:15] <zinid> you should also set usj
[16:48:39] <marc> Oh
[16:48:43] <marc> damn...
[16:48:54] pinky leaves the room: Stream reset by peer
[16:50:13] <zinid> I really don't understand where this jid:to_string comes from
[16:50:13] <marc> zinid, what is ljid?
[16:50:26] <marc> -type(ljid() :: {binary(), binary(), binary()}).
[16:50:28] <marc> :D
[16:50:43] <zinid> marc, https://github.com/processone/xmpp/blob/master/README.md#xmpp-addresses
[16:51:14] hlad leaves the room
[16:51:52] zuglufttier leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[16:52:22] <zinid> gosh, push_item() is fucking retarded
[16:52:24] suzyo leaves the room
[16:52:31] <zinid> cannot read mod_roster code, wtf...
[16:52:47] <zinid> my eyes are bleeding now
[16:52:52] <marc> :D
[16:53:14] <marc> zinid, why do I need the resource for set_roster() ?
[16:53:29] <zinid> marc, you ask me? 🙂
[16:53:39] <zinid> marc, ask the author of this shit
[16:53:52] <zinid> don't put resource there anyway
[16:54:00] <zinid> put <<"">> if asked
[16:54:21] <marc> good that my assumption that this is shit is correct :D
[16:55:51] <zinid> strictly speaking, back in the years the problem of full roster jids were not yet understood
[16:56:16] <zinid> nobody cared and everyone put full jid in the roster
[16:57:19] <marc> :>
[16:57:23] cromain leaves the room
[16:57:30] <zinid> so this is legacy shit and no matter how I tried to improve it I failed due to cryptic side effect impossible to debug
[16:58:10] jere leaves the room
[16:59:18] <Holger> marc, welcome to XMPP! Thanks for choosing this awesome protocol!
[16:59:55] <marc> Holger, sounds like an implementation issue, doesn't it? ;)
[17:00:13] <zinid> marc, it only sounds so in 2018
[17:02:24] <zinid> marc, still, there is a problem somewhere, jid:to_string() should not be called
[17:03:34] <zinid> run
$ make xref
[17:04:20] <marc> zinid, no errors anymore
[17:04:24] <marc> but also no push :(
[17:04:25] rom1dep leaves the room
[17:04:45] <zinid> ah, wait, no, I'm wrong, it's ok
[17:05:14] <zinid> are you sure you put correctly arguments in push_item()?
[17:05:31] <zinid> mod_roster:push_item(Inviter, Server, jid:make(Inviter, Server), Roster, Roster),
[17:05:38] <marc> maybe I mixed from and to
[17:05:46] <zinid> I think the push will be sent to Inviter@Server
[17:05:50] <zinid> is it expected?
[17:06:00] <marc> yes, to the inviter
[17:06:58] <zinid> ah, I'm wrong again
[17:07:27] <marc> the Roster is bullshit, right?
[17:07:55] <zinid> let me do some tests
[17:09:53] <marc>             mod_roster:set_roster(#roster{us = {Inviter, Server}, usj = {Inviter, Server, {Inviter, Server, <<"">>}}, jid = {JID#jid.user, JID#jid.server, <<"">>}, subscription = both}),
            mod_roster:set_roster(#roster{us = {User, Server}, usj = {User, Server, {User, Server, <<"">>}}, jid = {Inviter, Server, <<"">>}, subscription = both}),
            Roster = #roster{us = {Inviter, Server, {Inviter, Server, <<"">>}}, jid = {JID#jid.user, JID#jid.server, <<"">>}, subscription = both},
            mod_roster:push_item(Inviter, Server, jid:make(Inviter, Server), Roster, Roster),
[17:09:55] <marc> works :)
[17:10:06] <marc> my pushed roster item was wrong
[17:10:58] <zinid> <iq id="push10817728405282392321" type="set" to="user1@zinid.ddns.net/master" from="foo@bar.tld">
<query xmlns="jabber:iq:roster">
<item subscription="both" jid="foo@bar.tld"/>
</query>
</iq>
[17:11:04] <zinid> I receive the push
[17:11:50] <zinid> LJID = {<<"foo">>, <<"bar.tld">>, <<"">>},
...
mod_roster:push_item(<<"user1">>, <<"zinid.ddns.net">>, jid:make(LJID), R#roster{subscription = none}, R).
[17:12:07] <zinid> marc, set subscription 'none' on first Roster
[17:12:56] <zinid> ah, jid:make(LJID) is wrong of course, there should a user receiving the push
[17:13:09] <zinid> jid:make(<<"user1">>, <<"zinid.ddns.net">>) that is
[17:14:13] <zinid> https://gist.github.com/zinid/a4f300fed49cc0286c9ea2c2246293ae
[17:15:02] <marc> zinid, why none?
[17:15:11] <marc> I have a single push
[17:15:19] <marc> Why should this be 'none'?
[17:15:22] <zinid> marc, just shutup  and do 🙂
[17:15:45] <zinid> because it needs this info to correctly resend presences and probes
[17:15:52] <marc> zinid, my code works and 'none' doesn't make sense for the push IMO :D
[17:16:05] <marc> Otherwise I would shut up and do ;)
[17:16:15] <zinid> 'none' only on OldItem, NewItem should have 'both'
[17:16:25] <marc> ah
[17:16:41] <zinid> I said it right away actually 😉
[17:17:25] <marc> zinid, yeah, now I understand your sentence :)
[17:18:43] prefiks leaves the room
[17:19:12] <marc> still works, nice
[17:19:14] <marc> zinid, thanks
[17:28:21] pinky leaves the room: Stream reset by peer
[17:31:55] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[17:38:43] cippaciong leaves the room: Connection failed: connection closed
[17:41:49] jere leaves the room
[17:42:11] Akasch leaves the room
[17:43:48] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[17:47:30] <zinid> marc, for the record, it's probably better to send both pushes after both rosters are written
[17:47:39] <zinid> in order to avoid strange effects
[17:50:13] ChaosKid42 leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[18:02:28] rom1dep leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[18:10:46] ChaosKid42 leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[18:18:36] mimi89999 leaves the room
[18:26:58] rom1dep leaves the room: Stream closed by us: Replaced by new connection (conflict)
[18:27:40] SouL leaves the room
[18:34:51] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[18:34:53] pinky leaves the room: Stream reset by peer
[18:35:26] <marc> zinid: okay, will do
[18:37:16] rom1dep leaves the room: Stream closed by us: Replaced by new connection (conflict)
[18:37:54] erik leaves the room: Connection failed: timeout
[18:46:25] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[18:46:28] erik leaves the room: Stream closed by us: Replaced by new connection (conflict)
[18:52:39] ata2001 leaves the room: Disconnected: closed
[18:52:39] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[19:03:43] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[19:05:16] Man_Life leaves the room: Replaced by new connection
[19:13:40] pod leaves the room: Replaced by new connection
[19:21:22] Man_Life leaves the room
[19:30:53] ata2001 leaves the room: Disconnected: closed
[19:32:16] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[19:38:05] frainz leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[19:41:51] sezuan leaves the room: Replaced by new connection
[19:44:15] SouL leaves the room: Disconnected: closed
[19:45:15] pinky leaves the room: Stream reset by peer
[19:45:20] Licaon_Kter leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[19:48:22] SouL leaves the room
[19:57:59] SouL leaves the room: Disconnected: closed
[19:58:14] debalance leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[19:58:46] SouL leaves the room: Disconnected: closed
[20:02:40] SouL leaves the room
[20:03:26] pod leaves the room
[20:03:56] zinid leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[20:07:04] ata2001 leaves the room
[20:11:16] SouL leaves the room
[20:19:29] SouL leaves the room: Disconnected: Replaced by new connection
[20:20:21] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[20:26:06] rom1dep leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[20:27:10] hlad leaves the room
[20:28:13] suzyo leaves the room
[20:36:11] cippaciong leaves the room: Stream closed by us: Replaced by new connection (conflict)
[20:53:04] cippaciong leaves the room
[20:54:02] zinid leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[20:58:39] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[21:09:44] ileh leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[21:24:45] pinky leaves the room: Stream reset by peer
[21:25:48] srgcdev leaves the room
[21:28:43] joekokker leaves the room
[21:33:57] rom1dep leaves the room: Stream closed by us: Replaced by new connection (conflict)
[21:40:50] pod leaves the room
[21:41:25] Marzanna leaves the room
[21:54:31] joekokker leaves the room
[21:58:20] jeremy leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[22:05:15] joekokker leaves the room: Replaced by new connection
[22:11:12] frainz leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[22:25:28] cippaciong leaves the room
[22:28:03] sezuan leaves the room
[22:31:43] hlad leaves the room
[22:47:06] SaltyBones leaves the room: Machine going to sleep
[22:48:26] hlad leaves the room
[22:51:26] debalance leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[23:02:44] mimi89999 leaves the room
[23:12:13] ChaosKid42 leaves the room: Stream closed by us: Replaced by new connection (conflict)
[23:13:07] cippaciong leaves the room
[23:16:17] marc leaves the room
[23:17:42] mimi89999 leaves the room
[23:17:42] mimi89999 leaves the room: Disconnected: Received SIGTERM
[23:30:59] hlad leaves the room
[23:31:14] frainz leaves the room: Stream closed by us: Timed out waiting for stream resumption (connection-timeout)
[23:32:48] hlad leaves the room
[23:33:24] rom1dep leaves the room: Stream closed by us: Replaced by new connection (conflict)
[23:35:38] marc leaves the room: unknown reason
[23:36:45] marc leaves the room: unknown reason
[23:51:14] cippaciong leaves the room: Connection failed: connection closed
[23:56:30] frainz leaves the room: Stream closed by us: Replaced by new connection (conflict)
Powered by ejabberd - robust, scalable and extensible XMPP server Powered by Erlang Valid XHTML 1.0 Transitional Valid CSS!