cmeng-git / atalk-android

xmpp/jabber client for android
Apache License 2.0
155 stars 56 forks source link

Seeing `conflict` while trying to connect #192

Closed licaon-kter closed 1 year ago

licaon-kter commented 1 year ago

2.9.5 F-Droid

Server logs say

57:21.531519+00:00 [info] <0.300.0>@ejabberd_listener:accept/7:273 (<0.19310.0>) Accepted connection hidden_by_ejabberd -> IP:5222
57:21.822135+00:00 [info] <0.19310.0>@ejabberd_c2s:process_auth_result/3:268 (tls|<0.19310.0>) Accepted c2s SCRAM-SHA-1 authentication for user@domain.tld by sql backend from hidden_by_ejabberd
57:21.861041+00:00 [info] <0.19310.0>@ejabberd_c2s:bind/2:446 (tls|<0.19310.0>) Opened c2s session for user@domain.tld/atalk
57:21.997012+00:00 [info] <0.19298.0>@ejabberd_c2s:process_terminated/2:291 (tls|<0.19298.0>) Closing c2s session for user@domain.tld/atalk: Stream closed by local host: Replaced by new connection (conflict)

Reading http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions the client should change the resource, right? But it's always atalk?

licaon-kter commented 1 year ago

Retesting with 9c10c6d68fbc41392099072f6b22f1826563c5d2 it did login fine. So I guess it's fixed now. :)

cmeng-git commented 1 year ago

The message actually indicates that you are trying to login in at two places, but the server does not allow more than one login session. So the server replaces the first login session with the new login session. This is no a bug but server design intent.

57:21.997012+00:00 [info] <0.19298.0>@ejabberd_c2s:process_terminated/2:291 (tls|<0.19298.0>) Closing c2s session for user@domain.tld/atalk: Stream closed by local host: Replaced by new connection (conflict)

licaon-kter commented 1 year ago

Of course I am trying, since I have other clients connected with the same account.

I found later the "randomize" resource setting, why is that not default, or what's the workflow for multiple devices running aTalk?

cmeng-git commented 1 year ago

I am not sure if I fully understand your comment, but will try to answer to my best knowledge:

I found later the "randomize" resource setting, why is that not default. image

Not sure if you are referring to "Auto generate resource" option in the Jabber ID Resource section. Whether this option is enabled by default, is per each individual's preference.

aTalk decides to unchecked this option by default; In my personal view, the resource usually should be more meaningful rather with a randomise string e.g /desktop, /mobile1, /mobile2, /home or /office etc.

what's the workflow for multiple devices running aTalk

If you have multiple devices running aTalk, and with same xmpp user account, then you need to either enable "Auto generate resource" option for each device, or change the resources so there is not repeat of the same resource for the same user account.

If you have the same user account/resource registered with the same server, then the server will register the most recent login attempt as active; and returns an error for the older connection on another device

image