fix: GetConCliParam skips channels not yet identified#3716
Conversation
A channel becomes IsConnected() as soon as the first UDP audio packet arrives, but bIsIdentified is only set true once SetChanInfo() is called after the client's CHANNEL_INFO protocol message is received — one round-trip later (typically 20–200 ms). During that window GetConCliParam (used by getClients RPC and the GUI connected-clients list) returns a default-constructed CChannelCoreInfo with empty name, AnyCountry, and instrument 0 for the joining channel. Add IsIdentified() getter and gate GetConCliParam on both IsConnected() and IsIdentified(), matching the existing gate in PrepAndSendPacket that already withholds audio from unidentified channels.
|
Not quite sure this is the fix yet. testing... |
|
I think there's a reason it's the way it is -- the oldest clients didn't identify. They still need to be count as connected. 4.x does mean we could break this backwards compatibility but there would need to be a more compelling reason than "has no identifying information in the list". |
|
I'm running this new code. Does that mean old clients fail to connect to my modified server? Or maybe they just don't get listed on my modified getClients API? serverrpc.cpp and serverdlg.cpp call GetConCliParam. Populating both with what is known seems like a key objective. Wouldn't want the extremely old client to be invisible in the Connect dialog. Instead, I guess their name just appears? I think I know how tiny this user's plight is, as most users probably have newer clients, but I don't know how impactful it is. Being invisible from the main console while sonically present would of course be a hacker-fabulous calamity, but I don't think that would be the outcome. I might have to spin up an impossibly old client to figure this out! I will go to my unfortunate grave hoping for reliability in the instrument and nation ancillary metadata, because I use the name-instrument-nation trifecta as our simulacrum of identity. Sensing strangers when they're actually friends is a setback for custom welcome messages. See how rich they can be when they work: Jeff → Studio D (May 27) ▎ Welcome back, Jeff — your 5th consecutive Tuesday here! You have the room to yourself for now, but Ally should be here in about an hour. Marsha K (Jazz Jam host) should be here in about 27 minutes. The Jazz Jam is Tuesdays 8pm California time, and you can listen and record at StudioD.Live. Ally → Studio D (May 27) ▎ Welcome back to the Jazz Jam, Ally — your third Tuesday in a row! Marsha K is predicted to arrive in about 12 minutes. You can listen live or record MP3s at StudioD.Live. moon → Sindone (May 29) [translated from German] ▎ Welcome, moon — first time here! MikZ is also online right now — you probably remember him from last night. In the room: Nico (Keyboard, France) and Claudio (Electric Guitar, Italy). over_32keys → Green Mill (May 29) [translated from Japanese] ▎ Welcome, over_32keys — first time here! Ant-----Horns is live at Gaia right now. Melange → Hot Texas! (May 28) ▎ Welcome, Melange — back for your second Tuesday! Nomaste is already here! nono → Sindone (May 29) [translated from French] ▎ Welcome, nono — first time here! nils (Flute, Germany) is already there. Giancaudio (Keyboard, Rome) just arrived too. labru → Hot Texas! (May 28) ▎ Welcome, labru — first time here! Nomaste and Melange are in the room. You're the only bass player right now. Daniel → Windy (Chicago) (May 29) [translated from Portuguese] ▎ Welcome, Daniel — first time here! The room is just starting, with RL (bass, Boston), Bill Weidner and Leo (drums). You're the only guitarist. Almost a complete band — just missing a keyboard/piano! Murphy → Freiheit (May 28) [translated from French] ▎ Welcome back, Murphy. The group has been going for about 6 minutes, with El Barto (electric guitar, Germany), HarryCan (mic, Germany) and Tobi (Germany), and they need a bass! Susan → Hot Texas! (May 28) ▎ Welcome, Susan — first time here! You just missed Gary (guitar) — was here for a bit about half an hour ago. [unnamed] → Hot Texas! (May 28) ▎ You've been busy tonight — 4 servers in the last 2 hours. You can use /stream to listen or record from most browsers. ▎ Welcome back, Jeff — your 5th consecutive Tuesday here! de 2 → Studio D (May 27) ▎ Welcome back, de 2 — 13 consecutive Tuesdays, you're a regular here for the Jazz Jam with Marsha K! ... Also online right now: Doug W. Marsha K → Studio D (May 27) ▎ Welcome home, Marsha K — 20 hours here and you're the heart of the Jazz Jam! Tuesdays at 8pm California time. In the room, de 2, Curt, and Eric are new to Jamulus — glad to have them. THIS IS THE BUG, CUZ THOSE GUYS ARE NOT NEW TO JAMULUS, but they look new when their instrument / country is missing. Marsha K → Studio D (May 27, later) ▎ Welcome back, Marsha K — right on time for your Jazz Jam! Jeff, Curt, Eric, de 2, and Rob2 are also here and ready to play. |
|
If they've got as far as having names, they have a full connection with the profile stuff too, don't they? Or maybe that's the stuff that was added later. (I know the jam recorder starts recording before even the name arrives, so if you've got a name, you're doing well.) |
|
Sounds like wont-fix so let's hope it's will-warn.
I don't see any evidence of any "additional information" kind of content in our published API documentation. This is the source for that: Lines 56 to 69 in 2736f69 @brief probably should be the description of the API, but I don't see anything like @remarks or @notes here: https://github.com/jamulussoftware/jamulus/blob/main/tools/generate_json_rpc_docs.py So how should additional operational details be added to the API documentation? |
Problem
GetConCliParam(the backend for thejamulusserver/getClientsJSON-RPC method and the GUI connected-clients list) filters channels withIsConnected()only.IsConnected()becomestrueas soon as the first UDP audio packet arrives. ButbIsIdentifiedis only settrueinsideSetChanInfo(), which is called after the server sendsReqChanInfoand the client responds with itsCHANNEL_INFOprotocol message — typically one round-trip (20–200 ms) later.During that window,
GetConCliParamreturns a default-constructedCChannelCoreInfofor the joining channel: empty name,QLocale::AnyCountry, and instrument 0 (GetNotUsedInstrument()). Any consumer reading the connected-clients list in that window gets stale data.Fix
IsIdentified() constpublic getter toCChannel(mirrors the existingIsConnected()getter)GetConCliParamonIsConnected() && IsIdentified()Channels in the pre-identification window become invisible to
GetConCliParamuntil their full profile is committed. This is consistent with the existing gate inPrepAndSendPacket, which already withholds audio delivery from unidentified channels.The
serverdlg.cppGUI path also callsGetConCliParamand receives the fix automatically.Testing
Verified that a newly connecting client does not appear in
getClientsoutput until name, country, and instrument are all populated.