Skip to content

Do not send initial message for "promoting the group"#16

Open
link2xt wants to merge 2 commits intomainfrom
link2xt/nyxqupwztlqs
Open

Do not send initial message for "promoting the group"#16
link2xt wants to merge 2 commits intomainfrom
link2xt/nyxqupwztlqs

Conversation

@link2xt
Copy link

@link2xt link2xt commented Mar 18, 2026

This eliminates the possibility of the first message being lost. Pinger just starts sending messages, and receivers will get the group whenever some message arrives. The group is auto-accepted by setting the "bot" config, there is no need to accept "contact request" manually.

Closes #15, at least we will not get "WARNING: Only 0/1 receivers joined the group" and cmping does not get stuck completely.
Closes #13 which is another attempt to fix the same problem. This PR removes the code so there is no need to try to fix it.

I tested, it finished by itself after 3 pings and 60 second timeout when nothing is delivered:

$ cmping -c 3 sombras.chat nine.testrun.org
# using accounts_dir for sombras.chat at: /home/user/.cache/cmping/sombras.chat
# using accounts_dir for nine.testrun.org at: /home/user/.cache/cmping/nine.testrun.org
# Setting up profiles... Done!
# Waiting for profiles to be online... Done!
CMPING sombras.chat(mm88vn9ef@sombras.chat) -> nine.testrun.org(group with 1 receivers) count=3 interval=1.1s
--- mm88vn9ef@sombras.chat -> 1 receivers statistics ---
3 transmitted, 0 received, 100.00% loss
--- timing statistics ---
account setup: 3.82s
message send/recv: 63.33s
send rate: 0.05 msg/s

The other way round there is reordering and no loss, also finishes:

$ cmping -c 3 ci-chatmail.testrun.org sombras.chat
# using accounts_dir for sombras.chat at: /home/user/.cache/cmping/sombras.chat
# using accounts_dir for ci-chatmail.testrun.org at: /home/user/.cache/cmping/ci-chatmail.testrun.org
# Setting up profiles... Done!
# Waiting for profiles to be online... Done!
CMPING ci-chatmail.testrun.org(cnbpz1v1r@ci-chatmail.testrun.org) -> sombras.chat(group with 1 receivers) count=3 interval=1.1s
64 bytes ME -> ci-chatmail.testrun.org -> sombras.chat -> ME seq=0 time=4694.39ms 1/1 (elapsed: 0.00ms)
64 bytes ME -> ci-chatmail.testrun.org -> sombras.chat -> ME seq=2 time=4706.04ms 1/1 (elapsed: 0.00ms)
64 bytes ME -> ci-chatmail.testrun.org -> sombras.chat -> ME seq=1 time=34896.99ms 1/1 (elapsed: 0.00ms)
--- cnbpz1v1r@ci-chatmail.testrun.org -> 1 receivers statistics ---
3 transmitted, 3 received, 0.00% loss
rtt min/avg/max/mdev = 4694.388/14765.807/34896.993/17434.120 ms
--- timing statistics ---
account setup: 4.12s
message send/recv: 36.01s
send rate: 0.08 msg/s
recv rate: 0.08 msg/s

link2xt added 2 commits March 18, 2026 20:15
This eliminates all the possibilities of this initial
message sending failing and warnings like
"WARNING: Only 0/1 receivers joined the group".
It is ok for receivers to not get a number of messages at first,
they will have the chat created as soon as they get a single message.
@link2xt link2xt requested review from hpk42 and j4n March 18, 2026 23:31
Copy link

@j4n j4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, makes the tool quite a bit more snappy too. I did implement your suggested direct mode as well, but this addresses the issue elegantly.


# Wait for all receivers to join the group
wait_for_receivers_to_join(args, sender, receivers)
# Phase 2: Group creation
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor: This says Phase 2, which, referring to the timed phases (line 433), its no longer timed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ping gets stuck completely if joining the group fails

2 participants