matterbridge icon indicating copy to clipboard operation
matterbridge copied to clipboard

ShowJoinPart from IRC doesn't generate any part messages for netsplits

Open vaguerant opened this issue 4 years ago • 1 comments

Describe the bug ShowJoinPart in a chat relaying from IRC doesn't report disconnects caused by netsplits at all. This may extend to other network-side disconnections, but I don't have control of an IRC network to test any other ways servers can disconnect users. Messages are generated when the netsplit resolves and users rejoin, but there's no message for when the netsplit starts and they disconnect. On the non-IRC side, a series of netsplits just looks like the same set of users joining the channel over and over.

Probably a hard issue to test unless somebody wants to set up their own network where they can trigger netsplits at will, or otherwise prompt disconnections from the server-side instead of the user-side.

To Reproduce

  1. Set up a relay between IRC (I tested on EFnet) and somewhere else (I tested on Matrix but I suspect that part is not important).
  2. Add ShowJoinPart=true to the config on the non-IRC side.
  3. Witness a netsplit, or possibly any other server-directed disconnect? (i.e. Not a user /part or /quit)
  4. Observe that no part/quit/disconnect messages occur, the users just disappear completely silently.

Expected behavior I expect some kind of quit/part/disconnect messages akin to other ways that users disconnect from IRC.

Screenshots/debug logs If applicable, add screenshots to help explain your problem. Use logs from running matterbridge -debug if possible.

Unfortunately, I can't trigger netsplits at will, so I can't really get a log of this.

Environment (please complete the following information):

  • OS: Linux (Raspbian on a Pi 3)
  • Matterbridge version: 1.23.2 73ec02ab

Additional context

[irc]
[irc.efnet]
Server="irc.efnet.org:6697"
UseTLS=true
SkipTLSVerify=true
Nick="$$$$$"
RemoteNickFormat="<{NOPINGNICK}> "
ColorNicks=true

[matrix]
[matrix.matrix]
Server="https://matrix.org"
Login="$$$$$"
Password="$$$$$"
RemoteNickFormat="<{NOPINGNICK}> "
NoHomeServerSuffix=true
ShowJoinPart=true

[[gateway]]
name="$$$$$"
enable=true

[[gateway.inout]]
account="irc.efnet"
channel="$$$$$"

[[gateway.inout]]
account="matrix.matrix"
channel="$$$$$"

vaguerant avatar Nov 15 '21 12:11 vaguerant

After further testing, this is a mis-report, I am getting no part messages of any kind from EFnet, only joins are coming through, Will attempt to get a debug log next time I get the opportunity.

EDIT: Relevant log section:

time="2021-11-16T21:05:30+11:00" level=debug msg="<= Sending JOIN_LEAVE event from irc.efnet to gateway" func=handleJoinPart file="bridge/irc/handlers.go:112" prefix=irc
time="2021-11-16T21:05:30+11:00" level=debug msg="<= Message is config.Message{Text:"$$$$$ joins", Channel:"$$$$$", Username:"system", UserID:"", Avatar:"", Account:"irc.efnet", Event:"join_leave", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), ID:"", Extra:map[string][]interface {}(nil)}" func=handleJoinPart file="bridge/irc/handlers.go:114" prefix=irc
time="2021-11-16T21:05:30+11:00" level=debug msg="=> Sending config.Message{Text:"$$$$$ joins", Channel:"$$$$$", Username:"system", UserID:"", Avatar:"", Account:"irc.efnet", Event:"join_leave", Protocol:"irc", Gateway:"$$$$$", ParentID:"", Timestamp:time.Date(2021, time.November, 16, 21, 5, 30, 733925303, time.Local), ID:"", Extra:map[string][]interface {}(nil)} from irc.efnet ($$$$$) to matrix.matrix ($$$$$:matrix.org)" func=SendMessage file="gateway/gateway.go:479" prefix=gateway
time="2021-11-16T21:05:30+11:00" level=debug msg="=> Receiving config.Message{Text:"$$$$$ joins", Channel:"$$$$$:matrix.org", Username:"<s\u200bystem> ", UserID:"", Avatar:"", Account:"irc.efnet", Event:"join_leave", Protocol:"irc", Gateway:"$$$$$", ParentID:"", Timestamp:time.Date(2021, time.November, 16, 21, 5, 30, 733925303, time.Local), ID:"", Extra:map[string][]interface {}(nil)}" func=Send file="bridge/matrix/matrix.go:129" prefix=matrix
time="2021-11-16T21:05:30+11:00" level=debug msg="Channel $$$$$:matrix.org maps to channel id $$$$$:matrix.org" func=Send file="bridge/matrix/matrix.go:132" prefix=matrix
time="2021-11-16T21:05:31+11:00" level=debug msg="== Receiving event: &gomatrix.Event{StateKey:(*string)(nil), Sender:"$$$$$:matrix.org", Type:"m.room.message", Timestamp:1637057130910, ID:"$_Ay1Oz5O6dvrps0ic2OdmZwaVRDJuAzkdx3WIcuq68c", RoomID:"$$$$$:matrix.org", Redacts:"", Unsigned:map[string]interface {}{"age":124, "transaction_id":"go1637057130739250433"}, Content:map[string]interface {}{"body":"<s\u200bystem> $$$$$ joins", "format":"", "formatted_body":"&lt;s\u200bystem&gt; $$$$$ joins", "msgtype":"m.notice"}, PrevContent:map[string]interface {}(nil)}" func=handleEvent file="bridge/matrix/matrix.go:354" prefix=matrix
time="2021-11-16T21:05:31+11:00" level=debug msg="mID matrix.matrix: $_Ay1Oz5O6dvrps0ic2OdmZwaVRDJuAzkdx3WIcuq68c" func=SendMessage file="gateway/gateway.go:498" prefix=gateway
time="2021-11-16T21:05:31+11:00" level=debug msg="=> Send from irc.efnet ($$$$$) to matrix.matrix ($$$$$:matrix.org) took 475.380937ms" func=func1 file="gateway/gateway.go:488" prefix=gateway
time="2021-11-16T21:06:33+11:00" level=debug msg="<= Sending JOIN_LEAVE event from irc.efnet to gateway" func=handleJoinPart file="bridge/irc/handlers.go:112" prefix=irc
time="2021-11-16T21:06:33+11:00" level=debug msg="<= Message is config.Message{Text:"$$$$$ quits", Channel:"read error: connection reset by peer", Username:"system", UserID:"", Avatar:"", Account:"irc.efnet", Event:"join_leave", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), ID:"", Extra:map[string][]interface {}(nil)}" func=handleJoinPart file="bridge/irc/handlers.go:114" prefix=irc
time="2021-11-16T21:06:52+11:00" level=debug msg="<= Sending JOIN_LEAVE event from irc.efnet to gateway" func=handleJoinPart file="bridge/irc/handlers.go:112" prefix=irc
time="2021-11-16T21:06:52+11:00" level=debug msg="<= Message is config.Message{Text:"$$$$$ quits", Channel:"read error: connection timed out", Username:"system", UserID:"", Avatar:"", Account:"irc.efnet", Event:"join_leave", Protocol:"", Gateway:"", ParentID:"", Timestamp:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), ID:"", Extra:map[string][]interface {}(nil)}" func=handleJoinPart file="bridge/irc/handlers.go:114" prefix=irc

To me, this looks like the "receiving" lines are missing for all quits and only appear for joins? But I can barely read.

vaguerant avatar Nov 16 '21 04:11 vaguerant

#1948 marked a similar issue as cantfix because quits are not associated with channels; closing this issue by the same logic.

vaguerant avatar Aug 29 '23 13:08 vaguerant