jamulus icon indicating copy to clipboard operation
jamulus copied to clipboard

Client does not update window on server name change

Open pljones opened this issue 2 years ago • 11 comments

Describe the bug

If a server is restarted, changing the configuration to have a new server name, if it had been recording before the change, the client - still connected - does not update the recording banner.

To Reproduce

  1. Start a server named "Server A" on the command line, with recording enabled, activate recording.
  2. The red recording banner appears indicating recording is taking place at "Server A".
  3. The window title says "Server A".
  4. Restart the server with the name "Server B" on the command line.

Expected behavior

  1. The red recording banner should say "Server B".
  2. The window title should say "Server B"

Screenshots

Original server started:

Jamulus     2059       1  0 Sep20 ?        00:00:09 /opt/Jamulus/bin/Jamulus-server -n -s -p 54850 -T -F -P -u 50 -l /opt/Jamulus/log/Jamulus.log -e anygenre2.jamulus.io:22224 --serverpublicip 192.168.1.19 -R /opt/Jamulus/run/recording -o jamulus.drealm.info;London;224 -w /opt/Jamulus/systemd/welcome-server.html

-o jamulus.drealm.info;London;224 -> "jamulus.drealm.info"

Initial server connection: image Window title and recording banner on initial connection: image

Original server stopped and replaced on same port:

Jamulus     8281       1  7 18:06 ?        00:00:06 /opt/Jamulus/bin/Jamulus-original-music -n -s -p 54850 -T -F -P -u 10 -l /opt/Jamulus/log/Jamulus.log -e jamulusdirectory8.drealm.info:22824 --serverpublicip 81.174.155.168 -R /opt/Jamulus/run/recording --norecord -o Original Music;London;224 -w /opt/Jamulus/systemd/welcome-original-music.html

-o Original Music;London;224 -> "Original Music"

Connection window shows new name (and the welcome message was shown) but recording banner and window title are not updated: image

Version of Jamulus

Client: 3.10.0 Server: 3.10.0

pljones avatar Sep 21 '23 17:09 pljones

I'm pretty sure the reason for this is the client is responsible for actively retrieving the server details when it connects. As it doesn't think a new "connection" (in Jamulus terms - udp being connectionless anyway) has been established, it doesn't make the request.

Anyone any ideas on a backwards compatible fix? (i.e. one where no change to the server would be needed.) (I'm assuming nearly all clients do get updated to latest version.)

pljones avatar Sep 21 '23 17:09 pljones

Can we emit something like a server Info changed message from the server?

ann0see avatar Sep 26 '23 07:09 ann0see

Old servers won't do it -- that's the main problem. Many, many servers don't get updated.

pljones avatar Sep 26 '23 16:09 pljones

I mean the client could also request it itself, but I don't think it's worth it...

ann0see avatar Sep 26 '23 19:09 ann0see

The client wouldn't know when to request it.

pljones avatar Sep 26 '23 19:09 pljones

Yes. And thus poll for it, which is inefficient.

ann0see avatar Sep 26 '23 19:09 ann0see

Actually, this might work as client only...

  • the server, on start up, thinks no clients are connected
  • when it first gets ("on-going" for the client) audio from a connection, it goes through its own connect processing - sending stuff like the welcome message, full client list and any "you must accept the licence" notice - as well as the server details

The client, however, only expects and deals with some of that when it thinks it's connecting. For example, whilst it will display a server licence, I think it only pops up the "Accept" box when "connecting" and, as observed, ignores the server details.

So yes, that's something to investigate. A plan slowly emerges 😄 .

pljones avatar Sep 27 '23 08:09 pljones

This means that we could configure the client to also react on updates from the server side.

ann0see avatar Sep 30 '23 19:09 ann0see

This means that we could configure the client to also react on updates from the server side.

Yeah, I think so.

pljones avatar Oct 02 '23 17:10 pljones