176 KiB
The session seam: the engine on voelin_proto::link::Session
Status: design (2026-10-20); slices 1, 2 and 3 are implemented (section 13
says how slice 1 differs from this text, sections 14 and 15 what its reviews
changed, section 16 what slice 2 built, found and corrected, section 17 what
slice 3 moved, changed and ran, 17.7 the round after its review, which
brought the branch onto main ad20979, and 17.8 the round after the gate of the
merge; 17.6 has the complete edge list for the second half); section 10 has
the slices.
Design for the first half of plan step 7 (Phase 4): the engine consumes
voelin_proto::link::Session, ServerLink becomes an adapter over it, and
the TeamSpeak link (TsLink) becomes a Session implementation that still
lives in this repository, in process. The second half (the TeamSpeak
Session implementation moves to VoelinGateWay as voelin-gateway-ts, and
voelin-stream's dependency on voelin-media is split) is out of scope
here; section 11 lists what it has to do.
Read for this design: crates/voelin-core/src/link.rs, ts_link.rs,
voice.rs, book.rs, stream.rs, files.rs, session.rs (its use of the
link), tests/link_fake.rs, voelin-audio/src/packet.rs; and in
VoelinProtocol (main at the pin of that round; moved to c5bb6b9 by task 34)
crates/voelin-proto/src/link.rs,
media.rs with media/, test_util/ (FakeHost, FakeSession,
FakeConnector, FakeAccountAgent, the conformance suite),
proto/voelin/v1/*.proto, crates/voelin-model/src/replica/ and
docs/protocol.md sections 1.2, 1.3, 2.4, 2.5, 4.7, 5, 6, 9.1, 11 and 13.8.
1. Terms and the decisions in one place
| Term | Meaning here |
|---|---|
| engine | voelin-core without the TeamSpeak implementation: lib.rs, session.rs, history, contacts, cache, settings, the audio thread, the adapter below. |
| SessionLink | New, engine side. A ServerLink whose connections are Arc<dyn Session>s from the registry: it turns LinkCmds into Session calls and pushes, signals and media into LinkEvents. session.rs keeps talking LinkCmd/LinkEvent to it. |
| Backends | New, engine side. The registry of connectors by address scheme: voelin_proto::link::Connectors plus the in-process connectors that also hand the engine local ports (below). |
| LinkSession | New, TeamSpeak side. A Session over any ServerLink, generic in the link. LinkSession<TsLink> is the in-process TeamSpeak Session; LinkSession<FakeLink> is what the link tests run through. |
| TsConnector | New, TeamSpeak side. The Connector for ts3server and teamspeak (and addresses without a scheme) that makes LinkSession<TsLink>s. |
| StreamPort | New, local extension. The in-process channel that carries LinkCmd::Stream and the stream events past the Session trait while TeamSpeak 6 streams are not yet v1 entities (section 6.4). |
| old model | The client's TeamSpeak-shaped types (Presence, ChannelInfo, ClientInfo, ChatMessage, ServerDetails) that session.rs and the UI use. |
Decisions:
- Two adapters, one vocabulary in the middle.
session.rsis not rewritten: it keepsLinkCmd/LinkEvent. SessionLink translates them to and from v1; LinkSession translates v1 to and from the inner link'sLinkCmd/LinkEvent. With a fake link inside, the pair round-trips, so the existing FakeLink tests check both translations (slice 1). - The engine keeps a replica. SessionLink feeds every push into
voelin_model::replica::Replicaand projects it into the old model withreplica::convertplus the fix-ups of section 5.3. This needs the protocol'svoelin-model(a superset of the client's, byte for byte the same inpresence.rs,server.rs,chat.rs,percent.rs), so slice 1 switches the client'svoelin-modelto the protocol crate (the plan's section 4 already moves it there). Two crates namedvoelin-modelin one graph would makescripts/own-crates.sh's-p voelin-modelambiguous, so there is no half-way. - Streams stay on a local port in this half. TeamSpeak 6 streams are
peer to peer; v1 carries only their signalling (
Stream,Viewer,RespondViewer,KickViewer,Signal{stream}, protocol 6.11 and 11.1). Moving the str0m peer out of the TeamSpeak stream task and mapping its signalling is the second half's first item; hereLinkCmd::Streamand the stream events pass throughStreamPort, unchanged. - File transfers go through v1 now.
read_file/write_filecarry them; the engine does the copying, progress and cancel itself, and the TeamSpeak side hands out the raw transfer connection (two new inner commands, section 8). - TeamSpeak-only connect options ride the
ts3server://link thatvoelin_model::link::ServerLink::to_urlalready writes (channel/cid,channelpassword), until v1 has a field for them (follow-up P1); the client versionTsConnectorimpersonates rides it too, as a parameter of our own (client_version). - No TeamSpeak type crosses the seam: what crosses is
voelin_prototypes, the old model (TeamSpeak-shaped, but the client's own types),voelin-audiopackets and the core-owned stream types. Section 10 says which public items still namevoelin-streampeer types, and why.
2. Shape after this half
UI ── Engine (Command / Event) ── session.rs (merge, dedup, history, contacts)
│ LinkCmd ↓ ↑ LinkEvent
SessionLink (engine side: replica, projection,
│ media framing, transfers, talk tracker)
│ Arc<dyn Session> + pushes + MediaSink
│ (+ StreamPort for in-process connectors)
Backends ─────┼──────────────────────────┐
(scheme registry) ▼ ▼
TsConnector → LinkSession<TsLink> any Connector: FakeConnector
(ts3server, teamspeak, no scheme) (tests), QuicConnector (later)
│ LinkCmd ↓ ↑ LinkEvent (inner, TS side)
TsLink: voice.rs, book.rs, stream.rs, versions.rs,
identity.rs on tsclientlib, voelin-stream
The gateway (tsgw) and ServerQuery sources of a session are not behind
the seam in this half: they are the other two sources of session.rs
(gateway.rs, query.rs) and become a second Session to a gateway daemon
later (protocol 11.2, follow-up H5). Only their public command types change
in slice 3 (section 10).
3. The mapping
3.1 LinkCmd → Session
Every variant of voelin_core::link::LinkCmd. "SessionLink" is what the
engine does; "LinkSession" is how the TeamSpeak side answers. S is the
server id from the connect sequence (section 4.2), P our participant id,
slot our media slot. Text in errors is reproduced exactly as TsLink
writes it today (section 4.6).
LinkCmd |
Session call (SessionLink) | Answer and what the engine reports | LinkSession (TeamSpeak side) |
|---|---|---|---|
SendChat(target, text) |
request(Put{writes:[Message{channel_id, text, format, nonce}]}). Channel(cid): that channel. Server: the channel of kind SERVER_CHAT in SERVER(S). Private(uid): the DM channel in HOME whose other recipient's User has that uid; without one, first request(Put{Channel{server_id:0, kind:DM, recipients:[user]}}). format: BBCODE when the session offers chat.bbcode, else MARKDOWN. |
Entities ignored (the Change that follows is the echo, section 3.2). Rejected → LinkEvent::Error("message: {Error.message}"). No User for uid → Error("private message: the client is not on the server (send an offline message instead)"), without a request. |
Inner SendChat. A VOICE channel other than our own is refused NOT_IN_CHANNEL. Answered at once with the message as written (local id and rev): TsLink reports success of a text message nowhere, failures come later as a notice (section 3.2). The answer adds no Change: the inner link's echo is the Change, with an id of its own, because the inner link does not tie the echo to the send (H1 does). A Put Channel{DM} answers the synthetic DM channel (section 5.2) and puts it in HOME. |
Move(channel, password) |
request(JoinVoice{server_id:S, channel_id, password}) (None → empty). |
Own VoiceState → nothing (the move shows in LIVE). Rejected → Event::JoinFailed{channel, reason}: PASSWORD → JoinFailure::Password, FULL → Full, any other → Other(Error.message). |
Already in that channel and no move of ours on its way: answer the own VoiceState, send nothing (today ChannelAlreadyIn is silent too). While a move is on its way the snapshot is where we were, not where that move leaves us, so the request goes to the link whatever channel the snapshot shows (a move back into the channel we never left is answered when the first move is refused, or when its channel is the snapshot's). Else inner Move; answered when our channel becomes channel_id (own VoiceState), refused when the inner link reports Event::JoinFailed for it (Password → PASSWORD, Full → FULL, Other(text) → FORBIDDEN with text), SessionError::Timeout after 10 s. The first JoinVoice of a connection confirms the seat (section 4.2). |
SetInputMuted(b) |
notify(Put{Write{VoiceState{S, P, self_mute:b}, paths:[self_mute]}}) (protocol 4.7: own voice flags are fire and forget). |
Err only for a closed session: ignored. |
Inner SetInputMuted(b). |
SetOutputMuted(b) |
notify(Put{Write{VoiceState{S, P, self_deaf:b}, paths:[self_deaf]}}). |
As above. | Inner SetOutputMuted(b). |
Audio(EncodedVoice) |
send_media(MediaClass::Voice, MediaPacket{flow: FlowId::new(slot, voice_sub::CHANNEL), rtp}), RTP as in section 6.1. |
Dropped: counted (stats). NotOwned (no slot yet), TooLarge (over stats().max_rtp): dropped, logged once per connection. Closed: ignored. |
Inner Audio(EncodedVoice{codec, payload}) for our own slot only (section 6.2). |
Stream(StreamCmd) |
None in this half: StreamPort::send(cmd) (section 6.4; the v1 mapping of every StreamCmd is table 6.4). Without a port the engine reports no streams capability, so session.rs never sends it. |
Bus events and OwnStream/StreamAudio/StreamAudioEnded come back through the port. |
Inner Stream(cmd), in issue order with everything else (one queue). |
Poke{client, message} |
request(Signal{to:SignalTarget{server_id:S, participant_id:client}, body:Poke{message}}). |
Ack → nothing. Rejected → Error("poke: {Error.message}"). |
Inner Poke; answered Ack at once (failures come as a notice). |
ListFiles{request, dir} |
request(List{kind:FILE, parent:dir.channel, path:dir.path, password}) (refused locally without files). |
Event::FileList{request, channel, path: files::normalize_dir(path), result}: Ok with each FileEntry as files::FileEntry{name, size, modified_s: modified_ms/1000, is_dir}, or Err(text). |
Inner ListFiles with a request id of its own; its Event::FileList becomes the Entities answer (modified_ms = modified_s * 1000), or Rejected with the text. |
Download{transfer, file, sink, report} |
report(Requested), then read_file(FileRead{target: Path(FilePath{channel_id, path, password}), offset: sink.offset(), length:0}); the engine runs files::download (made generic over AsyncRead) on Download.body with FileEntry.size from head. A picture (transfer: None) keeps today's limit (cache::MAX_PICTURE_BYTES) and deadline (image_download_time), now applied here. |
TransferStates through report, as today. Err → report(Failed(text)). The task is kept under transfer for CancelTransfer. |
Inner OpenRead (new, section 8): the TeamSpeak transfer connection itself becomes body, head is FileEntry{size}. No deadline of its own: the engine puts one on a picture's negotiation (IMAGE_NEGOTIATION) and none on a file the user asked for, and a caller that drops the call takes the inner job with it. |
Upload{transfer, file, from, overwrite, resume, report} |
Size and kind of from checked here (today's texts: "{path} is not a file", "{path}: {error}"). With resume, the offset is the size of the target in List{FILE} of its directory (0 when absent). write_file(FileWrite{target: Path(...), size, offset, overwrite}); the engine runs files::upload (generic over AsyncWrite) into Upload.body, then awaits Upload.done. |
TransferStates as today; Done after done resolved. |
Inner OpenWrite (new): the transfer connection becomes body; the server's seek position must equal offset, else CONFLICT "the server has N bytes" (follow-up P4). done resolves when the inner job reports the end. No deadline of its own, as for a download. |
CancelTransfer(id) |
No call: the engine aborts its copy task (dropping the body cancels on both v1 and TeamSpeak), removes the .part file, reports Cancelled; an unknown id is logged, as today. |
— | The dropped connection ends the TeamSpeak transfer. |
DeleteFiles{request, channel, password, paths} |
request(Delete{keys:[FileEntry{channel_id, path: dir, name, password}...]}), one key per path (/dir/name split at the last /). |
request: Some → Event::RequestDone{request, result}; None → nothing (best effort). |
Keys grouped by channel → inner DeleteFiles{request: Some(own id)} each; RequestDone → Ack or Rejected. |
RenameFile{request, from, to} |
request(Put{writes:[Write{FileEntry{channel_id: to.channel, path, name, password: to.password, from_channel_id: from.channel, from_path: from.path, from_password}}]}) (a create of an unused key: no paths). |
RequestDone{request, result}. |
Inner RenameFile. |
CreateDirectory{request, dir} |
request(Put{writes:[Write{FileEntry{channel_id, path, name, is_dir: true, password}}]}). |
RequestDone{request, result}. |
Inner CreateDirectory. |
SetAvatarHash{request, hash} |
request(Put{writes:[Write{User{id: own user, avatar: Image{hash}}, paths:[avatar.hash]}]}) (the leaf path, so the myTeamSpeak url in the same Image stays). |
Some(request) → RequestDone; None → Rejected becomes Error("avatar: …"). |
Inner SetAvatarHash. (replica::convert reads the TeamSpeak avatar from User.avatar.hash; follow-up P7 on Member.avatar.) |
OfflineList{request} |
request(List{kind:MAIL}) (refused locally without mailbox). |
Event::OfflineMessages{request, result} from the Mails (OfflineMessageInfo fields from id, from_uid, from_name, subject, ts_ms, read). |
Inner OfflineList; its event becomes Entities[Mail…]. |
OfflineGet{request, id} |
request(List{kind:MAIL, ids:[id]}) (v1: List{MAIL, ids} returns the text). |
Event::OfflineMessage{request, result}. |
Inner OfflineGet. |
OfflineAdd{request, to_uid, subject, text} |
request(Put{writes:[Write{Mail{id:0, to_uid, subject, text}}]}). |
RequestDone. |
Inner OfflineAdd; answers the mail as written (id 0: messageadd returns none). |
OfflineDelete{request, id} |
request(Delete{keys:[Mail{id}]}). |
RequestDone. |
Inner OfflineDelete. |
OfflineFlag{request, id, read} |
request(Put{writes:[Write{Mail{id, read}, paths:[read]}]}). |
RequestDone. |
Inner OfflineFlag. |
Disconnect |
close(CloseCode::Normal, ""), then closed(). A closed command channel does the same. |
LinkEvent::Disconnected(None) (section 4.5). |
Inner Disconnect; closed() resolves Local(Normal) when the inner link reports its end. |
Requests with a RequestId that cannot be sent (no session yet, closed)
answer as today: session.rs already reports "not connected with voice"
before a link exists; SessionLink reports SessionError texts (4.6).
LinkSession::notify follows the Session contract (it errors for a closed
session or a misplaced op, as FakeSession does): Hello, List,
FileRead and FileWrite are Protocol errors, because they have a stream
and an answer of their own (placement); our own mute flags go to the link;
any other op of the control stream is run as the request it is, and its
answer, or its refusal, is told to nobody.
3.2 Session → LinkEvent
Every variant of voelin_core::link::LinkEvent.
LinkEvent |
Source on the Session side |
Rule |
|---|---|---|
Connected{name, backend, capabilities, own_client, server_uid, own_uid} |
Welcome, the SERVER(S) sync, the answer to the first JoinVoice, the own User. |
Sent once, after the connect sequence (4.2). name = Server.name; backend from Welcome.host.backend (table 4.7); capabilities from features() (table 4.7); own_client = P as u16; server_uid = server_key(Server.uid) (5.3, F3); own_uid = uid_text of the own User (the User of our VoiceState.user_id, else Welcome.user_id), None when the replica has none yet. |
Presence(Box<Presence>) |
Change/SyncEnd of SERVER(S) and LIVE(S); talk tracker. |
After the pushes that are there now are applied (drain, then one snapshot), if SERVER or LIVE changed: replica.presence_model(S) with the fix-ups F1-F10. One TeamSpeak book update is one inner Presence, one or two Changes, and still one snapshot. |
OwnChannel(cid) |
Our VoiceState.channel_id in LIVE. |
After every Presence, when known and not 0 (as TsLink does after every snapshot). Our VoiceState is the one of the seat, and behind a TeamSpeak server it follows the seat to the participant that is us after the link's own reconnect (4.4); the OwnChannel of the inner link only tells LinkSession that a move has arrived. |
Chat(ChatMessage) |
Change.put of a Message, and messages of a SyncBegin..SyncEnd, in a subscribed CHAT scope (4.3). |
Once per (channel_id, id) per connection, and only once the replica can show it: a full sync stages its messages until its SyncEnd, so the messages of a CHAT scope are reported at its SyncEnd as well (4.3). replica.chat_message(channel, id) gives target, author name, author uid, author participant, ts_ms, via_relay (MESSAGE_FLAG_RELAYED). Answers to our own Put are not applied to the replica: our own message is reported when its Change arrives, which is today's echo, and session.rs merges it with the row it stored (test a_sent_message_and_its_echo_are_one_message). |
Poke{from, from_uid, from_name, message} |
Push Signal{from_user, from_participant, body: Poke{message}}. |
from = from_participant as u16; from_uid = uid_text of User(from_user); from_name = the participant's VoiceState.nick, else the User.name. A sender outside our view is delivered as a bare User first (5.2). |
Audio(VoicePacket) |
MediaSink packets on a voice slot. |
Section 6.1. |
Talking{client, talking} |
MediaSink packets on a voice slot (protocol 6.4: talking in the own channel comes from media), and Signal{speaking} (below). |
The first packet of a slot → true; 400 ms without one → false (250 ms tick): the rule of voice.rs today. TsLink also hears talkers whose packets it does not forward as Opus (Speex, CELT): LinkSession passes the inner link's Talking on as Signal{speaking}, and SessionLink holds such a talker as talking until the host says on: false (no silence ends it). Also fills ClientInfo.talking (F8). |
OwnStream(OwnStreamEvent) |
StreamPort events. |
Passed through. |
StreamAudio{stream, time, data} |
StreamPort events. |
Passed through. |
StreamAudioEnded(stream) |
StreamPort events. |
Passed through. |
Error(text) |
(a) Rejected answers to commands that have no RequestId (SendChat, Poke, SetAvatarHash{request: None}); (b) push Signal{notice{level: ERROR or WARNING}}; (c) ScopeClosed of SERVER(S) or LIVE(S). |
(a) "{what}: {Error.message}", what = message, poke, avatar (today's labels); (b) Notice.text; (c) ScopeClosed.message, and the presence is emptied. |
Disconnected(reason) |
closed(); a failed connect; a connect sequence that does not finish. |
Section 4.5. Sent once; the StreamPort's closing events may follow, as the contract of link.rs already allows. |
What the Session side produces and no LinkEvent carries, with the
decision for each:
| Session output | Decision in this half |
|---|---|
Push::SyncBegin/SyncEnd/Change of HOME |
Applied to the replica: DM channels (CHAT subscriptions, 4.3), the own User, bare Users of senders. No event of their own. |
Push::Heads |
Ignored: no unread source in the engine uses it yet (TeamSpeak sends none). |
Push::HostUpdate |
Updates the feature set SessionLink checks requests against. Capabilities are not announced again: LinkEvent has no update, and TeamSpeak never sends one. Follow-up (client): Event::ServerInfo again on a HostUpdate. |
Push::ScopeClosed |
CHAT: unsubscribed, nothing reported. SERVER or LIVE: Error and an empty presence (row Error above). HOME: logged. |
Signal{typing} |
Ignored (the engine has no typing indicator; TeamSpeak types only in DMs). |
Signal{stream}, Signal{layer_target} |
Not sent by LinkSession (streams use the port). Ignored with a log. Second half: the engine's stream task (H2). |
Signal{encoder_hint} |
Ignored. Follow-up (client): Opus bitrate and packet_loss_perc from it (protocol 6.7). |
Signal{reminder} |
Ignored (no events feature in the engine). |
Signal{notice{level: INFO}} |
Logged at info. |
Signal{speaking} |
A hint next to the media: the host says a participant talks or stopped (LinkSession sends it for the inner link's Talking, which is all there is for a talker without Opus). Not asked for with SUBSCRIBE_OPTION_SPEAKING; talking in other channels stays a follow-up (P13). |
Media on stream slots (sub 0-4), FlowId::FEEDBACK, FlowId::PROBE |
Dropped (no SFU streams in this half). |
stats() (LinkStats) |
Section 4.7. |
Connected.host_uid |
Not pinned for TeamSpeak ([0; 32], no host key). Kept for a later pin store for voelin:// hosts. |
Welcome.resume_token, Welcome.ice, Welcome.observed_addr, Welcome.time_ms |
Kept by SessionLink, unused in this half (4.4). |
Welcome.limits |
max_chat_subscriptions bounds the CHAT scopes (4.3). max_message_chars is not enforced (the UI's own limit stays). |
4. How the engine owns a Session
4.1 The registry
voelin_core::link::Backends holds the connectors by scheme:
connectors: voelin_proto::link::Connectorsfor plain connectors (Backends::register(Arc<dyn Connector>):FakeConnectorin tests, the QUIC connector later);- in-process connectors that also give local ports: a crate-private trait
LocalConnector: Connectorwithconnect_local(params, LocalCtx) -> BoxFuture<Result<LocalConnected, SessionError>>, whereLocalCtxis what an in-process backend needs besidesConnectParams(session id, the event bus, the frames bus, the settings, the stream peer configuration, whether audio is open) andLocalConnectedisConnectedplusOption<StreamPort>.
Lookup: the scheme of ConnectParams.address (lowercase, before ://); an
address without a scheme is a TeamSpeak bookmark and gets ts3server. A
local connector for the scheme wins over a plain one; none → Disconnected
with "no connector for {address}" (the text of Connectors::connect, but with the address cut at ? and #: the text is shown and logged, and a TeamSpeak link carries a channel password and a pin).
Engine::start and start_with use Backends::default(), which registers a
TsConnector (schemes ts3server, teamspeak) of its own. The connector owns
the myTeamSpeak account (4.8: since a451f02 it holds the senders and has the
setters; an application that sets the account registers its connector with
Backends::register_teamspeak). New:
Engine::start_with_backends(settings, history, backends).
Engine::start_with_link(settings, history, link) stayed in slices 1 and 2: it
registered a local LinkConnector that answers every scheme with a
LinkSession over the given link, so the link tests went through the whole
adapter. Slice 3 removed it (17): the tests that needed it build the same
registry themselves.
4.2 Connect sequence
SessionLink is a ServerLink: session.rs calls spawn exactly as today
and shows Connecting until Connected.
- Build
ConnectParams(section 7 for the credential). In slice 1 the options still carry TeamSpeak types, so one function of the TeamSpeak module,ts_session::connect_params(&ConnectOptions), builds them; it also writes the resolved client version into the link parameterclient_versionin a text form of its own. Slice 3 moves the building into SessionLink over the neutralVoiceOptions, andclient_versioncarries the user's spec instead. The fields:address= thets3server://link of the bookmark address withchannel/cidandchannelpassword(ServerLink::to_urlof the model'slink.rs; a name clash with the trait, nothing more), or the address as given when it has a scheme;hello=Hello{version:1, client: ClientInfo{name:"Voelin", version, platform, kind}, nickname, password: server password, invite_code: privilege key, ..};host_pin: None;trust: refuses (no TOFU dialog yet; TeamSpeak has no host key);media: SessionLink's sink;push_capacity: 1024;timeout: 35 s(the TeamSpeak connect gives up at 30 s with its own text, which should win);account: None,issuer_trust: Unknown,linked: []. The link can hold a channel password: neither side logs it (the connector logs the host and port), andsession.rskeeps keying history and aliases by the bookmark address, not by the link. What the link round trip (address_linkhere,inner_optionson the TeamSpeak side) does to an address, since a link cannot say all an address can: a bookmarkhost[:port]whose port is not a number from 1 to 65535 (host:99999,host:abc,[::1]:) is refused in words, where the link would drop the port and connect to the default one; so is a bookmark whose host holds a?,#,/or%, white space or a control character (the link ends a host at the first three, decodes the fourth, and a?would hide the channel behind the next one), or is empty or an unclosed[. The TeamSpeak library could not resolve any of them either. Normalised, not refused: blanks around a bookmark are cut;[v6]with no port comes back asv6(the library reads both); an empty server password, channel, channel password or privilege key is none (the channel password already was); an address that is ats3server://link keeps the model's rules for links (aport=that is no port is ignored, other keys are ignored), and the options given next to it win over its parameters. The error shows the address without its query (the connect fails withDisconnected(Some(text))before any connector is asked). Backends::connect.Err(e)→Disconnected(Some(text(e))), end.request(List{kind: SERVER}); the serverSis the only one listed (or the lowest id; follow-up P3 for hosts with several).FakeHostfiles noServerstub in HOME (follow-up P9), so HOME is not used to find it.SubscribeHOME, SERVER(S) and LIVE(S), each afterreplica.subscribe.- Apply pushes until the three
SyncEnds. 30 s without them → close,Disconnected(Some("timed out while connecting")). If the push channel ends meanwhile the session has ended:closed()says why, and that is the reason ofDisconnected(a kick during the syncs is shown as one). request(JoinVoice{server_id:S, channel_id, password}):channel_idfrom the bookmark's channel (/<id>directly, a path resolved in the synced tree withsplit_channel_path), elseServer.default_channel_id. The answer is ourVoiceState:P,slot. TeamSpeak seats a client at connect, soLinkSessionanswers the firstJoinVoiceof a connection with the seat it has (participant = our client id, channel as far as it knows it, 0 before the first snapshot) and moves nothing; the seat was chosen by the link'schannelparameter. A refused firstJoinVoice→ close,Disconnected(Some(Error.message)).- Report
Connected, thenPresence, thenOwnChannel(the ordersession.rsand its tests expect). - Subscribe CHAT for the server chat, our channel and each DM (4.3).
- Loop,
select!biased in this order: the command channel, media, pushes, the stream port, the session's own notices,closed(), the 250 ms tick (talk tracker, stats). The bias is no order: the events that come from media (Talking,Audio) and the ones that come from pushes (Presence,Chat,Poke,Error) travel in two channels, and nothing in the engine, the tests included, may rely on one coming before the other (section 13). A packet from a slot the replica does not know yet fetches the queued pushes first and tries again (on_media).
LinkSession answers List{SERVER}, Subscribe and Unsubscribe from its
own state, without an inner command; an op it does not implement is
UNSUPPORTED with the op's feature in Error.feature.
4.3 Which CHAT scopes
TeamSpeak delivers the chat of our own channel, the server chat and private messages; everything else needs a gateway. SessionLink subscribes exactly that: CHAT(server chat channel), CHAT(our channel) (re-subscribed when we move, the old one unsubscribed), and CHAT(dm) for each DM channel HOME holds.
The number of CHAT scopes is Welcome.limits.max_chat_subscriptions (0 or
no Limits: the v1.0 default, 16). LinkSession says 65,536 and enforces
it: it is no limit a connection reaches, because a private message from
somebody new makes a conversation, and a connection on a busy server meets
more than 16 people. Against a host with a small limit the server chat and
our channel come first, then the private conversations, the newest
(highest id) first.
A message that arrives before its
scope is subscribed is not lost: LinkSession keeps the messages of the
connection per channel (the 50 newest, the default CHAT window of
protocol 5.4) and sends them in the full sync; SessionLink reports each
(channel, id) once. A full sync is staged by the replica until its
SyncEnd, so a message of its Changes cannot be read when the Change
is applied (and SyncBegin, Change and SyncEnd may come in different
batches): SessionLink marks a message as reported only once it has shown it,
and at the SyncEnd of a CHAT scope it shows the messages of that channel
it has not shown yet (test
the_messages_of_a_chat_sync_are_reported_when_the_sync_ends). A first private message from someone new therefore
arrives as: HOME Change (the DM channel), Subscribe CHAT(dm), its sync.
A cursor kept per CHAT scope makes a re-subscription after moving back a
delta where the session offers sync.delta (LinkSession does, within one
connection).
4.4 Reconnect and resume
- Engine-initiated (
Command::ConnectVoiceagain): unchanged.session.rsgives the old linkStreamCmd::Shutdown, thenDisconnect; both reach the old session through one ordered queue (4.5), and the generation filter drops what the old one still says. - Transport: TeamSpeak's own reconnect inside
tsclientlib(DisconnectedTemporarily) stays invisible at the seam, as it is today (the snapshots go on). The connection comes back as another client: a new client id, the same unique id and database id.LinkEvent::Connectedis not repeated (as today), but the engine does not stay the client of the connect: we are the client of our unique id.LinkSessiontakes the client it was for as long as that client is in the snapshots, and when it is gone the client of our unique id (the newest, when a ghost of the old connection lingers: while the ghost is there we stay on it, as a second client of one identity may be a second connection of ours); the own client keeps the database id when two clients share it, so the user we are is the same through the reconnect;Session.send_mediafollows the slot. SessionLink (behind a TeamSpeak host only: a participant is ours for the life of any other session) keeps its seat while the participant is ours, and moves it to the participant that carries our user id when the seat is gone or no longer carries it; a seat whose user id changed by itself (the snapshot that tells our database id came after the seat) is followed.OwnChannel, the voice flags, the uplink slot and the chat scope of our channel follow the seat (teststhe_engine_follows_a_reconnect_that_makes_us_another_client,we_stay_the_client_we_were_while_it_is_there). The native TeamSpeak session of the second half starts a new epoch instead (H1). - Resume:
LinkSessiondoes not offerresume. SessionLink keeps the lastWelcome.resume_tokenand the CHAT cursors per session and address, and sends neither in this half: novoelin://connector is registered. Reconnecting with backoff (protocol 2.5) is the SDK's (H8). Until then a reconnect to a v1 host replays the window of each CHAT scope: the engine stores every replayed message again, and shows again those thatDedupno longer holds (F3, 16.5).
4.5 Close
| How it ended | closed() |
LinkEvent::Disconnected |
|---|---|---|
LinkCmd::Disconnect, or the command channel closed |
Local(Normal) |
None |
| The inner link ended unasked without a reason | Remote{code: Normal, reason: ""} |
None |
| The inner link ended with a reason (kicked, server gone, timeout) | Network(reason) |
Some(reason) |
| A v1 host closed with a code | Remote{code, reason} |
Some(reason), or the code's name when reason is empty; None for Normal with no reason |
| Idle timeout | TimedOut |
Some("timed out") |
LinkSession keeps one queue for everything that reaches the inner link:
Session calls, StreamPort sends and close. The order a caller issues
them in is the order the inner link sees (the Session contract for
mutations, and what a_reconnect_shuts_the_streams_down_before_the_old_connection
checks: Stream(Shutdown) before Disconnect).
4.6 Errors and their texts
text(SessionError): Rejected(e) → e.message; Closed(reason) → the
reason as in 4.5; Timeout → "timed out while connecting" during connect,
"timed out" otherwise; Unsupported(f) → "not offered by this server: {f}";
HostIdentity(t), Protocol(t) → t; Io(e) → e.to_string().
LinkSession puts TsLink's own texts in Error.message and
CloseReason::Network, so what the user reads does not change.
4.7 Where Features, BackendInfo and LinkStats surface
Welcome.host.backend → BackendInfo:
v1 BackendInfo{product, flavor} |
engine BackendInfo.product |
|---|---|
teamspeak, ts3 |
TeamSpeak 3 |
teamspeak, ts6 |
TeamSpeak 6 |
teamspeak, empty (not recognised) |
empty (version = what the server said) |
| anything else | product as given |
LinkSession writes the inverse from the inner Connected.backend
(TeamSpeak 3 → teamspeak/ts3, ...), so every value round-trips.
features() (narrowed by Server.features) → Capabilities. SessionLink keeps
the host's set (Session::features(), replaced by each HostUpdate) and the
set of the server (Features::narrowed(&Server.features), recomputed when
the SERVER scope changes or syncs and after a HostUpdate); Capabilities,
the local refusals (Features::require) and the presence fix-ups use the
narrowed one. LinkSession files no Server.features (an empty list keeps
all of them):
Capabilities |
from |
|---|---|
streams |
streams, and the connection has a StreamPort (this half) |
file_transfer |
files |
offline_messages |
mailbox |
raw_query, ssh_query, http_query |
no feature: they describe ServerQuery access to a TeamSpeak server, not the session. Derived from the flavor as ServerFlavor::capabilities does (ts3: raw and SSH; ts6: SSH and HTTP). They go with the query observer (H5); follow-up P10. |
LinkSession's features are what it implements: voice, chat,
chat.bbcode, dm, sync.delta, roles, roles.channel; with file
transfer files, files.upload; with offline messages mailbox; with
streams streams, streams.p2p, streams.audio, streams.approval. Not
voice.whisper, chat.typing or the moderation set: the inner link cannot
do them (the native session of H1 offers the whole TeamSpeak column of
protocol 9.1). SessionLink refuses locally (Features::require) what needs a
missing feature: List{FILE}, file reads and writes (files,
files.upload), Mail (mailbox).
LinkStats: no UI surface in this half (the engine has no event for
connection quality). SessionLink reads stats() on the tick: max_rtp
bounds outgoing voice packets; rtt, loss, media_dropped and degraded
are logged at debug every 10 s and when degraded changes. LinkSession
reports max_rtp: MAX_RTP and zeros. Follow-ups: an engine event for
connection quality, and the encoder's FEC and loss from LinkStats and
encoder_hint (protocol 6.7).
4.8 What LinkCtx becomes
LinkCtx field |
Where it goes |
|---|---|
session |
SessionLink (it reports with it); LocalCtx.session for the stream task. |
events |
SessionLink reports answers itself; LocalCtx.events for the stream task's bus events. Inside LinkSession, the inner link gets a bus of its own: FileList, JoinFailed, OfflineMessages, OfflineMessage and RequestDone from it answer pending requests, every other event (the stream task's) is forwarded to the engine's bus unchanged. Capacity 4096, and every pending request has a timeout, so a lagging receiver cannot hang one forever. |
frames |
LocalCtx.frames, passed to the inner link as is. |
settings |
SessionLink (progress cadence files.progress_ms); LocalCtx.settings for the stream task. |
myts_identity, myts_data |
TsConnector (it got the engine's watches in slices 1 and 2; since slice 3 it owns the senders and has the setters, 17); the account hook of section 7 replaces them later (H4). |
5. Presence across the seam
5.1 The rule
project(translate(p)) == p for every presence a TeamSpeak link reports:
translate is LinkSession's old model → v1 entities, project is
SessionLink's replica → old model. A unit test checks it on the book
fixtures of book.rs (TeamSpeak 3 and 6) and on a generated set of
TeamSpeak-shaped presences; the FakeLink tests check it end to end.
5.2 Ids and entities on the TeamSpeak side
Protocol 11.1 "Ids", made concrete for LinkSession:
| v1 | from the old model |
|---|---|
| server id | 1 (one virtual server per connection) |
Server (SERVER(1)) |
ServerDetails and server_name; uid = ts: + the server uid TsLink computes; host_message_mode, banner, host button, icon (Image{hash: id}), max_members, priority_dim_db, default_role_id = sgid, default_channel_role_id = cgid with bit 62; foreign{system:"teamspeak", kind:"server", json:{"platform", "version"}}, the strings the server sent (F4, F5) |
| channel id | cid; kind: VOICE; position from the order chain (1024 per step); needed{TALK}; icon; banner; max_members (with foreign{"max_clients":0} for a limit of 0, F7) |
| server chat | Channel{id: 1 << 63, kind: SERVER_CHAT} in SERVER(1) |
| DM channel | Channel{id, server_id: 0, kind: DM, recipients: [own user, peer user]} in HOME, made when a message to or from the peer needs it; id has bit 63 set and the FNV-1a 64 hash of the peer's uid in the low 63 bits (1 when they come out 0, so it never equals the server chat's id) |
| role id | sgid (RoleScope::SERVER); cgid with bit 62 (RoleScope::CHANNEL); position = −sort_id; name_mode; kind; icon |
| user id | database_id; a sender with none, or outside our view, gets bit 63 set and the FNV-1a 64 hash of its uid in the low 63 bits |
User |
uid = base64-decoded unique id, uid_kind TS3 (TS6 on a TeamSpeak 6 server); a uid that is not canonical base64 (a ServerQuery client's login name) leaves uid empty and goes into foreign{system:"teamspeak", kind:"user", json:{"uid"}} (F10); name; avatar: Image{hash: avatar MD5, url: myTeamSpeak avatar}; badges; country |
Member |
roles = server groups; channel_roles = {channel: channel group with bit 62}; description; foreign{system:"teamspeak", kind:"client", json:{"icon"}} (F6) |
Presence |
status: IDLE with text = away message when away, else ONLINE |
| participant id | client id; VoiceState{nick, channel_id, slot: client id + 1, self_mute, self_deaf, talker, talk_power, priority_speaker, channel_commander, recording, streaming, kind: QUERY for query clients} |
| message id | per connection: milliseconds since the Unix epoch shifted left by 12 bits, plus a counter in the low 12 bits |
| rev, epoch | one counter per LinkSession from 1; the epoch is new per connection |
Mail id |
the TeamSpeak offline message id |
Each inner Presence is diffed against the previous one: changed entities
are put, gone ones deleted, one Change per scope. A poke or chat message
from someone the snapshot does not hold is preceded by a Change that puts a
bare User (synthetic id, uid, name) into LIVE: it shows in no presence (no
VoiceState) and lets the engine name the sender (follow-up P5). A sender
the link names by its client id only (no unique id) gets the same: a User of
the synthetic id of client:<id> with the name the link gave and no uid,
replaced when the same client id comes back with another name (the link hands
a client id to whoever connects next).
5.3 The engine's projection: presence_model and its fix-ups
replica::convert targets the old model already. Where it says less than
TsLink does, SessionLink fixes the result up in one module
(link/project.rs), each fix with a follow-up for the protocol repository
(P6, P7). The old model is TeamSpeak-shaped, and these fix-ups apply the
TeamSpeak gateway's id rules of protocol 11.1 so the UI keeps the ids it
has; they go when the UI reads the replica (H7).
| Fix-up | Why | |
|---|---|---|
| F1 | Leave out channels of kind SERVER_CHAT, DM, GROUP_DM, THREAD. |
presence_model leaves out threads only; the server chat would show as a channel. |
| F2 | On a TeamSpeak backend (backend.product == "teamspeak"), clear bit 62 of RoleScope::CHANNEL role ids (channel groups, ClientInfo.channel_group, ServerDetails.default_channel_group). |
Today's ids are TeamSpeak's cgids; requests to the gateway and the UI's group lookups use them. |
| F3 | server_key(uid): Server.uid without a leading ts:; used for server_uid and ServerDetails.uid. |
History rows, aliases and the merge with the gateway and query sources are keyed by today's form. Goes with H5 (and a history key migration). |
| F4 | ServerDetails.version from Server.foreign (teamspeak/server, key version), else Welcome.host.backend.version. |
server_details leaves it empty by design, and BackendInfo.version is the parsed version, not always the string the server sent. |
| F5 | ServerDetails.platform from Server.foreign (teamspeak/server, key platform). |
v1 has no field for the server's OS. |
| F6 | ClientInfo.icon from Member.foreign (teamspeak/client, key icon). |
v1 has no client icon; client_info sets 0. |
| F7 | ChannelInfo.max_clients = Some(0) from Channel.foreign key max_clients. |
max_members: 0 means unlimited; a TeamSpeak limit of 0 cannot be said. |
| F8 | ClientInfo.talking = Some(talk tracker) where the session offers voice, else None. |
Talking comes from media (protocol 6.4); client_info sets None. |
| F9 | ClientInfo.streaming = None where the session lacks streams. |
client_info always gives Some; TeamSpeak 3 reports none. |
| F10 | ClientInfo.uid, a message author's and a poke sender's uid from User.foreign (teamspeak/user, key uid) when User.uid is empty. |
ServerQuery clients' uids are login names, which User.uid (bytes, base64 for TeamSpeak) cannot hold. |
5.4 Normalised fixtures
A TeamSpeak link never reports some states the FakeLink fixtures use; through the adapter they come back normalised, so slice 1 changes the fixture builders, never the assertions (except one, below):
- sibling channels form an order chain (
GAMES.order = LOBBY, not both 0); - every client has a
database_id,talking: Some(false)and thechannel_groupit would have (NonestaysNone); presence().servernames the server and its uid asTsLinkfills them;Talkingis played as a voice packet of the talker (LinkEvent::Audio), because the engine derives it from media; the test still expectsEvent::Talking{client: 8, talking: true};commands_reach_the_linkno longer expects the engine's request id (5) in the innerListFiles: the id the inner link sees isLinkSession's (v1 request ids belong to the session). This is the one changed assertion.presence_follows_the_link_until_it_disconnectsis the second changed test (after the request id, above): it plays the voice packet and waits forTalkingbefore it plays thePokeand theError, where the baseline playedTalking,PokeandErrorin one go and waited for them in that order. Its assertions are the baseline's; the steps are reordered because the media path and the push path have no order between them (section 13), and the first version of the test relied on one (it failed in 22 of 300 isolated runs on the first implementation; the fixed test, 0 of 300).
6. Media across the seam
6.1 Voice, engine side
voelin-audio's EncodedVoice/VoicePacket stay what the audio thread
speaks; SessionLink frames them in the v1 media codec (voelin_proto::media).
Sending (LinkCmd::Audio): flow FlowId::new(slot, voice_sub::CHANNEL)
(the engine has no whisper or priority voice yet), RtpHeader::new(PT_OPUS, seq, timestamp), SSRC = flow; seq counts every packet from 0;
timestamp advances by the previous packet's Opus duration
(media::opus::packet_ticks, 960 for 20 ms); marker on the first packet of a
spurt; EncodedVoice::is_end() becomes an RTP packet with an empty payload,
sent once (protocol 6.4 sends it twice; the TeamSpeak side would turn that
into two TeamSpeak end packets, so twice waits for H1). MediaClass::Voice.
Receiving (MediaSink::media, never blocking: into the loop's queue): a
voice flow is slot → our replica's VoiceState with that slot →
TalkerId(participant as u16); sub 1-6 → whisper: true; seq = RTP
sequence; payload = RTP payload (empty ends the spurt; VoicePacket::is_end
also takes one byte); codec = Music when the Opus TOC has the stereo flag,
else Voice. The codec is informational on this path: the jitter buffer
decodes every talker with one stereo decoder (jitter.rs), so a frame coded
mono inside a music stream decodes the same. Unknown slots are dropped
(logged once). The talk tracker sees every voice packet.
6.2 Voice, TeamSpeak side
LinkSession re-wraps, never transcodes (protocol 1.2): an inner
VoicePacket becomes RTP on the talker's slot (client id + 1), sub 1 for
whispers else 0, seq = TeamSpeak packet id, timestamp from the TOC
durations on an unwrapped packet-id counter and wall-clock time across
silences, marker after an end or 250 ms of silence, empty payload for the
end. Sub 7 (priority voice) is not used: the mixer dims by the presence's
priority_speaker flag, as today. Uplink: RTP on our slot loses its header
and becomes EncodedVoice{codec: Music if the TOC is stereo else Voice, payload}; the engine encodes VoiceCodec::Voice only (audio.rs), so
TeamSpeak keeps receiving Opus Voice. Packets of another slot are
NotOwned, over MAX_RTP TooLarge.
6.3 Media classes
| Class | Used in this half |
|---|---|
Voice |
our voice |
StreamAudio, Video, Feedback, Probe |
not used: TeamSpeak 6 streams are peer to peer, so no stream media crosses a Session (protocol 6.11, 11.1); the SFU path comes with VoelinServer |
6.4 Streams: the port now, v1 later
StreamPort is { cmds: UnboundedSender<StreamCmd>, events: UnboundedReceiver<StreamEvent> }, StreamEvent = OwnStream, StreamAudio,
StreamAudioEnded; the stream task's bus events go to the engine's bus,
its frames to the frames bus (both through LocalCtx). The watched streams'
video (StreamFrame) and audio never cross the Session trait in this half.
The v1 mapping the second half implements (H2), per StreamCmd variant:
StreamCmd |
v1 (peer to peer, what TeamSpeak 6 needs) | SFU (VoelinServer, later) |
|---|---|---|
Start{setup, auto_accept} |
Put Stream{kind, title, mode: P2P, access: OPEN if auto_accept else ASK, viewer_limit, audio, bitrate_kbps}; accessibility and mode 1 in Stream.foreign |
mode: SFU, layers |
Stop |
Delete Stream{id} |
same |
Respond{viewer, accept} |
RespondViewer{stream_id, participant_id, accept, offer} (offer from the engine's peer) |
without offer |
Kick{viewer} |
KickViewer{stream_id, participant_id, reason: KICKED} |
same |
Watch{stream_id} |
Put Viewer{stream_id, participant_id: P, audio, decodes} |
same |
Leave{stream_id} |
Delete Viewer (own) |
same |
RequestKeyframe{stream_id} |
inside the WebRTC peer (PLI) | RTCP PLI on FlowId::FEEDBACK (MediaClass::Feedback) |
Undecodable{stream_id} |
renegotiate without the codec (Signal{stream: offer}) |
Put Viewer{decodes} |
WatchLayer{stream_id, layer} |
Signal{stream: layer} (x-voelin-layer) |
Put Viewer{max_layer} |
Layers(specs) |
Put Stream{layers} and the local encoders |
same |
LayerFormat{layer, format} |
local (encoder to peer) | local |
SrtpProfiles(names) |
local (peer configuration) | n/a |
Frame(frame), VideoFrame(frame, format) |
local (the peer sends them) | send_media(Video, RTP on the stream slot, sub = layer) |
Friends(clients) |
local (stream.permissions decides who is admitted) |
access: FRIENDS on the host |
Directory(streams) |
the gateway daemon's session (protocol 11.2) | n/a |
Shutdown(reason) |
local (peer teardown), then close |
same |
And back: OwnStream ← our Stream in LIVE (put, viewer count, delete);
StreamAudio ← the peer (SFU: stream slot sub 4, MediaClass::StreamAudio);
StreamAudioEnded ← the stream or our Viewer deleted; the bus events
StreamsChanged, StreamViewers, StreamViewerRequest (a Viewer in state
PENDING), WatchState ← Stream and Viewer entities; StreamLayerBitrate
← the peer's estimate (SFU: Signal{layer_target}).
7. Identity and credentials
- TeamSpeak identities go as
Credential::Foreign{kind: "teamspeak", blob},blob= the JSON of theKIND_TEAMSPEAKIdentityBlobof the KeyStore (voelin-storekeeps tsproto'sIdentityJSON verbatim).TsConnectorparses it back into thetsclientlib::Identityit connects with. No identity in the options (voelinctlwithout--identity) is an empty blob, and the connector generates one astsclientlibdoes today (follow-up P11 writes the convention down). - The Voelin key goes as
Credential::Voelin(Arc<dyn Signer>): aKIND_VOELINblob'svoelin_key()(IdentityKeyimplementsSigner), or aFileSigner. Nothing uses it in this half (novoelin://connector), but the conversion is there and tested. - The account is a hook:
ConnectParams.accountisNoneandissuer_trustUnknown.Backendsgets anOption<Arc<dyn AccountAgent>>slot, set by nobody yet. A blob whose binding has custody SERVICE (no local secret) would beCredential::Account{kind: "teamspeak", integration_id}; without an agent the connector fails the connect (its contract inConnectParams), and the engine reports that asDisconnected. No such blob reaches the engine yet. myTeamSpeak keeps going throughTsConnector's watches (4.8) until it moves toAccountAgent::use_integration(myteamspeak.handshake, protocol 13.8; H4). - Host trust:
TsConnectorignorestrustandhost_pin(no TLS). The engine passes aHostTrustthat refuses until the UI has a TOFU dialog. - Slice 1 keeps the API:
VoiceOptions.identityis still atsclientlib::Identity; one function in the TeamSpeak module turns it into theCredential. Slice 3 makes it anIdentityBlob(section 10).
8. Files
The engine owns transfers end to end: progress (files.progress_ms), the
.part file and its rename, cancel, resume, the picture limits. The
TeamSpeak side only opens the transfer connection, through two inner
commands added to LinkCmd in slice 1:
OpenRead{file: Remote, offset, reply: oneshot<Result<(u64, BoxRead), String>>}:download_file, then theFileDownloadstream and its size go toreplyinstead of intofiles::download;FiletransferFailed→Errwith the texttransfer_errorwrites today.OpenWrite{file, size, overwrite, resume, reply: oneshot<Result<(u64, BoxWrite), String>>}:upload_file, then theFileUploadstream and itsseek_position.
files::download and files::upload take AsyncRead/AsyncWrite instead
of TcpStream (their tests keep using TCP). The old Download, Upload and
CancelTransfer handling in voice.rs is dead for LinkSession from
slice 1 (it never sends them inward) and is deleted in slice 3. Avatars and
icons keep their channel-0 paths (/avatar_<uid>, /icon_<id>) as
FilePath reads; v1 has them as attachments (H6).
9. Tests
9.1 tests/link_fake.rs through the adapter (slice 1)
Engine::start_with_link(FakeLink) now wraps the link in LinkSession and
drives it through SessionLink, so all seven tests run both translations:
| Test | What it proves through the adapter |
|---|---|
presence_follows_the_link_until_it_disconnects |
connect sequence and event order, presence round trip, poke, talking from media, notice → Error, Disconnected(Some) |
commands_reach_the_link |
SendChat, Move, SetInputMuted, Poke, ListFiles survive both translations; no streams without the capability; stream commands through StreamPort; replaced link gets Disconnect |
a_reconnect_shuts_the_streams_down_before_the_old_connection |
StreamPort and close share one ordered queue |
a_sent_message_and_its_echo_are_one_message |
our message's Change is today's echo |
a_message_that_comes_twice_is_shown_once |
four Changes, RELAYED flag, dedup in session.rs |
history_is_kept_across_the_connection |
DM channel in HOME, late CHAT subscription, Private(uid) target |
a_replaced_connection_is_ignored |
generation filter with a link that keeps talking after Disconnect |
9.2 FakeSession and FakeHost (slice 2)
New tests/session_fake.rs: Engine::start_with_backends with a
FakeConnector (scheme fake) registered, VoiceOptions::new("fake://host", ...), the FakeHost filled with Server, VOICE Channels, Roles,
Users, Members and VoiceStates through FakeHost::put (it stores what
a client cannot set, such as authors), FakeHandle for pushes, media,
scripts, held requests and kills. voelin-proto with test-util is a
dev-dependency of voelin-core.
| link_fake test | FakeSession version |
|---|---|
presence_follows_the_link_until_it_disconnects |
host state + JoinVoice (the fake assigns P and slot); Welcome.host.backend set with FakeHost::set_welcome; poke as FakeHandle::push(Signal{poke}); talking by inject_media on alice's slot; Signal{notice} → Error; kill(Network("server shut down")) → "voice: server shut down". |
commands_reach_the_link |
FakeHandle::requests() shows Put{Message}, JoinVoice{password}, the notify (id 0) of self_mute, Signal{poke} (the fake answers signals Ack), and List{FILE} (the fake refuses List.path: scripted with Script::answer("list", ...)). The stream half stays a link test (below). |
a_reconnect_shuts_the_streams_down_before_the_old_connection |
stays a link test: it checks the StreamPort ordering, which a FakeSession has no part in (until H2). |
a_sent_message_and_its_echo_are_one_message |
the fake stores our Put and pushes its Change to CHAT(our channel). |
a_message_that_comes_twice_is_shown_once |
four FakeHost::put(Message), one with MESSAGE_FLAG_RELAYED. |
history_is_kept_across_the_connection |
a DM Channel{server_id: 0} (HOME) and its messages; close and reopen. |
a_replaced_connection_is_ignored |
stays a link test: a closed FakeSession stops pushing, so the stale events cannot be produced on purpose. |
New tests the v1 path needs: a connect that fails (FakeConnector::fail_next)
→ Disconnected(Some(text)); CHAT re-subscription after moving back is a
delta (sync.delta); ScopeClosed of CHAT and of LIVE; Rejected answers
→ RequestDone/Error texts; our voice in FakeHandle::sent_media() (PT
111, SSRC = flow, marker, empty end, sequence); download and upload against
the fake's channel files, resume offset from a scripted List; offline
messages through scripted Mail answers (the fake does not store Mail);
HostUpdate changing the refused features; the conformance suite run
against a FakeSession reached through Backends (17 cases, a check that
the registry hands the session over untouched).
The link tests that stay (a_reconnect_shuts_the_streams_down..., the stream
half of commands_reach_the_link, a_replaced_connection_is_ignored) remain
in tests/link_fake.rs in slice 2 and move into the crate in slice 3, when
ServerLink is no longer public.
This table and the list above it are the design; section 16.4 lists where the
running code differs (the CHAT re-subscription is a full sync, not a delta; a
reconnect resumes nothing; the conformance run and the live TeamSpeak tests are
in-crate tests, not files of tests/).
9.3 The conformance suite against the TeamSpeak Session
conformance::run_case with a harness that opens a LinkSession<TsLink>
through TsConnector on the dev servers (VOELIN_LIVE=1, TeamSpeak 3 and 6
of dev/docker-compose.yml). The suite's Fixture needs a FakeHandle of
the backend; the TeamSpeak server has none, so the harness passes the handle
of an unrelated FakeHost and runs only the cases that never touch it:
| Case | Expected | Why |
|---|---|---|
welcome_matches_features |
passes | session only |
close_ends_the_session |
passes | session only |
a_stale_rev_conflicts_and_a_patch_writes_only_its_paths |
skipped | no chat.edit |
requests_apply_in_the_order_they_were_issued |
skipped | no chat.edit |
list_pages_history |
skipped | no chat.history (the embedded gateway keeps no history) |
idempotency_keys_apply_a_put_once |
skipped | no idempotency |
subscribe_syncs_the_scope |
cannot pass | writes to channel 4001, which the server lacks; TeamSpeak channel chat reaches only the own channel |
subscribe_resumes_from_a_cursor |
cannot pass | same (4002) |
put_answers_entities_and_pushes_the_change_with_the_same_rev |
cannot pass | same (4003) |
delete_answers_an_ack_and_pushes_the_removal |
cannot pass | TeamSpeak cannot delete a message; the case needs only chat instead of chat.delete, so it fails instead of skipping (P8) |
a_key_names_an_entity_without_its_server |
cannot pass | needs nothing, but creates ScheduledEvent and Emoji, which TeamSpeak lacks (P8) |
cancel_before_apply_is_cancelled |
cannot run | holds the backend (FakeHandle::hold) |
notifications_are_fire_and_forget |
cannot run | reads the backend's request log; typing goes to channel 1 |
renew_account_follows_the_feature |
cannot run | changes the backend's features by FakeHandle::push |
media_loops_back |
cannot pass | a TeamSpeak server does not return a client's own voice |
files_round_trip |
cannot pass | writes an AttachmentSlot; TeamSpeak has channel files, no message attachments; the case needs files instead of chat.attachments (P8) |
the_backend_can_end_the_session |
cannot run | FakeHandle::kill; and LinkSession reports a kick as Network(text), not Remote{KICKED}, until H1 |
What the suite cannot reach is covered by TeamSpeak session tests of their
own (live, both servers): an own-channel Put Message answered, then
pushed to the other session's CHAT scope and back to ours as a Change (ids
agree only with H1's native session); JoinVoice refusal codes
(PASSWORD, FULL); a poke Signal between two sessions; voice RTP from
one session's slot reaching the other's MediaSink (sequence, marker, end);
a channel file written with write_file and read back from an offset with
read_file.
The table above is the prediction. Section 16.2 has the verdicts the run
gave, on both servers, and what the run found on the way: the first version
of the harness ended its sessions by itself (16.5, F2), which made
close_ends_the_session pass for the wrong reason, and the reasons of the
cases that do not apply are what those cases did when they were run.
10. Slices
Every slice: cargo fmt --all --check; cargo clippy $(scripts/own-crates.sh) --all-targets --no-deps --locked -- -D warnings; cargo test -p voelin-core --locked (also --features media), the tests of every crate the slice
touches; cargo check --workspace --locked; cargo deny --locked check;
scripts/notices.sh with THIRD_PARTY_NOTICES.md regenerated whenever
Cargo.lock changes; docs on new public items; the live tests and
scripts/it-smoke.sh engine scenarios against the TeamSpeak dev servers
(this repository's dev/docker-compose.yml, the same as VoelinGateWay's)
with the results compared to the baseline. One commit per step is fine; no
history rewrite.
Slice 0 (precondition): baseline
On main (59fec5b), before any code: VOELIN_LIVE=1 cargo test -p voelin-core --features media-desktop --test live --test voice_features --test stream_live --test media_live, and scripts/it-smoke.sh ts3 ts6.
Record which pass, which fail and why: the plan notes they have not run
since Phase 4 step 1, and slice 1's "no behaviour change" is measured
against this record, not against an assumption.
Slice 1: the adapter
- Protocol crates at one revision.
voelin-identity,voelin-protoandvoelin-modelfrom VoelinProtocol at one rev (the main of the seam round or later: it hasAccountAgent,IssuerTrust,Credential::Account;voelin-identitychanged only incert.rsandrevocation.rssince64808cc).crates/voelin-modelis removed and every crate that used it takesvoelin-model = { workspace = true }(voelin-core,-ui,-gateway,-gateway-proto,-observer,-android,voelinctl: a one-line manifest change each, the UI's being a compile fix); the[patch]recipe ofdocs/building.mdgainsvoelin-model. Acceptance: whole workspace builds, all tests green, no source change besides manifests. Of the model crate's files onlylib.rs(two more modules,permsandreplica) andbadges.rs,link.rs,tree.rs(a doc comment and two equivalent expressions) differ. - The seam.
link/(Backends, SessionLink, project, media),ts_session.rs(LinkSession, TsConnector,LinkConnectorforstart_with_link),OpenRead/OpenWriteinvoice.rs,files.rsgeneric,Engine::start_with_backends. Acceptance:git diff main -- crates/voelin-core/src/session.rsis empty;- the seven tests of
tests/link_fake.rspass through the adapter with only the fixture changes of 5.4; - unit tests: the presence round trip of 5.1 (book fixtures and generated
presences),
LinkCmd→ v1 → innerLinkCmdfor every row of table 3.1 with a recording link, v1 media framing both ways (sequence, marker, end, whisper, TOC codec), talk tracker timing (400 ms), the close table of 4.5, the error texts of 4.6, the backend and capability tables of 4.7; - live tests and smoke scenarios: no result worse than the baseline
(section 0), in particular
engine_voice_check(files, avatar, poke, private and offline messages, friend online, blocked poke), voice round trip, the TeamSpeak 6 stream scenarios; rg -n 'tsclientlib|tsproto|voelin_query'over the new Session-facing modules (link/backends.rs,link/session_link.rs,link/project.rs,link/media.rs) is empty; TeamSpeak types appear only ints_session.rsand the files that had them before (link/mod.rskeepsConnectOptionsandLinkCtxuntil slice 3). No public item is removed in this slice.
Slice 2: tests on FakeSession and FakeHost
Implemented; section 16 says how, what it found, and what ran.
tests/session_fake.rsas in 9.2, the conformance run throughBackends(17 of 17), the live TeamSpeak conformance subset of 9.3 with the expected verdicts asserted per case (2 pass, 4 skipped, the rest not run, each with the reason of the table in a comment), and the TeamSpeak session tests of 9.3.tests/link_fake.rskeeps only the three link tests named in 9.2.- Acceptance: all of it green on both dev servers; a deliberately broken
translation (for instance a dropped
self_mutepath) makes asession_faketest fail, shown once in the report.
Slice 3: the ServerLink layer where it is redundant; TeamSpeak types out of the API
Implemented; section 17 says how, what differs from this list, and what ran.
ServerLink,TsLink,Engine::start_with_link,LinkCtx,LinkCmd,LinkEventandRemoteare no longer public (the engine keepsLinkCmdandLinkEventassession.rs's private vocabulary; the TeamSpeak module keeps the inner trait). The remaining link tests become unit tests in the crate.src/ts/holds the TeamSpeak implementation:ts_link.rs,voice.rs,book.rs,ts_session.rs,versions.rs,identity.rs(moved with history). Public asvoelin_core::ts:TsConnector(withset_myts_identityandset_myts_data),versions,identity. This module is what moves to VoelinGateWay.VoiceOptions(no longer an alias ofConnectOptions):identity: Option<IdentityBlob>,client_version: Option<String>(a spec forts::versions::resolve, passed toTsConnectoras the link parameterclient_version;Link::parseignores unknown keys),stream_peer: PeerConfig, the rest unchanged.Command::SetMytsIdentityandSetMytsDataremoved (nothing sends them;TsConnector's setters replace them).ObserveGateway.identitybecomes aBox<IdentityBlob>(gateway.rsparses it);ObserveQuery.connectbecomes a core-ownedQueryLogin(transport, address, user, secret, server port, server id) thatquery.rsturns intovoelin_query::Connect. The publicgateway::connect(url, identity)takes the blob too (nothing outside the crate calls it today).voice.rslosesDownload,Upload,CancelTransfer; the picture limits live in SessionLink only.docs/architecture.md: "The server link" becomes "The session seam" (registry, SessionLink, the TeamSpeak module,StreamPort, the fix-ups of 5.3, what is still TeamSpeak-shaped:u16client ids and the old model); the crate table row ofvoelin-corefollows; this document's status line.CHANGELOG.md: it lists user-visible changes only. An entry under "Changed" only if a difference against the baseline remains visible (none is intended); the reviewer confirms none was needed.- UI and
voelinctl: compile fixes only (identity blob instead oftsclientlib::Identity, the spec string forclient_version,voelin_core::ts::{versions, identity}paths,QueryLogin). - Acceptance:
rg -n 'tsclientlib|tsproto|voelin_query' crates/voelin-core/src --glob '!**/ts/**' --glob '!gateway.rs' --glob '!query.rs' --glob '!stream.rs'from the repository root (fromcrates/voelin-core/srcthe first glob is'!ts/**': a glob is relative to the directoryrgruns in) is empty, and the four exceptions use them privately:gateway.rsandquery.rsare the two observer sources (H5),stream.rsis the TeamSpeak 6 stream task behindStreamPort(H2, H3);session.rsnames no TeamSpeak crate;- no public item outside
voelin_core::tsnames a type oftsclientlib,tsproto*orvoelin-query(checked withcargo docand a grep ofpubitems);voelin_core::streamstill re-exports the WebRTC peer types ofvoelin-stream(PeerConfig,MediaFrame,MediaKind,MediaTime,Frequency,VideoFormat,VideoCodec,Codec,FrameSource,SyntheticSource): they belong to the peer, which protocol 6.11 and 11.1 keep in the client, and land in a crate of their own whenvoelin-streamis split (H3); cargo tree -p voelin-core -e normal | grep -E 'tsclientlib|tsproto'may still list them (the TeamSpeak module is still in the crate);- all of slice 1's and slice 2's checks, live tests and smoke included.
11. Follow-ups
11.1 For the protocol repository (seam, schema, model, suite)
Nothing here blocks this half: each has a workaround above.
| # | What | Workaround meanwhile |
|---|---|---|
| P1 | Hello has no initial voice channel (path or id, password) for backends that seat a client at connect; a Voelin host could also take it to save the JoinVoice round trip. |
ts3server:// link parameters channel/cid, channelpassword (4.2). |
| P2 | Write down that the first JoinVoice of a session that its backend seated at connect answers the seat without moving (11.1). |
LinkSession does it. |
| P3 | A host with several servers: the address (or Welcome) should name the one to use. |
List{SERVER}, the only or lowest one. |
| P4 | write_file should answer the offset the backend appends at (Upload.offset), so a resume needs no List. |
List{FILE} before a resumed upload; CONFLICT on a mismatch. |
| P5 | No sender name or uid for a Signal (poke) or message author outside the receiver's view (hidden ServerQuery clients). |
A bare User with a synthetic id before the signal (5.2). |
| P6 | Schema gaps of TeamSpeak presence: a client icon, a channel limit of 0, the server's platform and version string as sent, a uid that is no byte string (ServerQuery login names). | Foreign keys icon, max_clients, platform, version, uid (F4-F7, F10). |
| P7 | replica::convert: SERVER_CHAT and DM channels in presence_model; the per-server TeamSpeak avatar read from User.avatar instead of Member.avatar; streaming: Some(false) without the feature; empty version; channel role ids not given back; client icon 0; talking always None. |
Fix-ups F1-F10. |
| P8 | Conformance suite: a backend driver trait (hold, release, kill, push, request log) instead of FakeHandle, so backend-driven cases run on any backend; chat channel and server chosen by the harness instead of 4001-4020; needs fixed (chat.delete for the delete case; events and emoji for a_key_names_...; chat.attachments or a FilePath variant for files_round_trip); a two-session media_loops_back for backends that do not loop back. |
The subset of 9.3 and TeamSpeak tests of our own. |
| P9 | FakeHost files no Server stub or own Member in HOME (protocol 5.2). |
List{SERVER} (4.2). |
| P10 | ServerQuery capabilities (raw, SSH, HTTP) have no feature string. | From the flavor (4.7); they leave with the observer (H5). |
| P11 | Protocol 11.1 could name Hello.invite_code ↔ client_default_token (privilege keys), and section 13.8 the empty Credential::Foreign blob as "generate an identity". |
Done that way here. |
11.2 The second half (TeamSpeak Session to VoelinGateWay)
| # | What |
|---|---|
| H1 | A native TeamSpeak Session replaces LinkSession<TsLink>: voice.rs speaks v1 (book → entities without the old model, notifications → Changes), real answers for chat and pokes (read-your-writes, errors on the request), a kick as Remote{KICKED}, tsclientlib's own reconnect as a new epoch and a full resync, ping and loss in LinkStats, whispers (sub 1-6), priority voice (sub 7), typing, the end of a spurt sent twice collapsed to one TeamSpeak packet, every TeamSpeak feature of protocol 9.1. |
| H2 | Streams on v1: the stream task's WebRTC peer moves to the engine and speaks Stream/Viewer/RespondViewer/KickViewer/Signal{stream} (table 6.4); the TeamSpeak session translates TeamSpeak 6's stream commands (setupstream, joinstreamrequest, respondjoinstreamrequest, removeclientfromstream, streamsignaling, the notifications); StreamPort and LocalConnector's stream part go. |
| H3 | voelin-stream split rather than inverted: the TeamSpeak 6 signalling (commands, notifications, signal JSON) goes to VoelinGateWay with the TeamSpeak session; the str0m peer with PeerConfig, MediaFrame, VideoFormat, codecs and simulcast stays client side (with voelin-media, or a crate of its own), because protocol 6.11 and 11.1 put the peer in the client. Then nothing in VoelinGateWay depends on voelin-media, and the cycle the plan worries about cannot form. |
| H4 | myTeamSpeak through AccountAgent (myteamspeak.handshake with the 32-byte digest, the presentation, sign-out clearing, protocol 13.8) instead of TsConnector's watches; Credential::Account for custody SERVICE identities. |
| H5 | The gateway (tsgw) and query sources become a second Session to a gateway daemon (protocol 11.2); then F3's ts: rule (with a history key migration) and the query capabilities go. |
| H6 | Avatars and icons as attachments (Image.attachment_id, content-addressed cache) instead of channel-0 paths. |
| H7 | The UI on the replica (Phase 5): the old-model projection and F1-F10 go; u16 client ids widen to u32 participants. |
| H8 | Reconnect with backoff, resume tokens and persisted cursors move to voelin-sdk once it exists; the engine consumes the SDK. |
| H9 | Move src/ts/ (with its live tests) to voelin-gateway-ts (features basic, streams), first behind a ts feature of voelin-core, then by git tag; the exit check of plan step 6, cargo tree -p voelin-core -e normal | grep -E 'tsclientlib|tsproto' empty, holds after H1-H3, H5 and this (17.6 has the complete list of the edges between the engine and src/ts/, the stream split and the other crates that carry tsclientlib). The first two to cut run from the engine into src/ts/: Backends::default registers ts::TsConnector (the ts feature makes it optional), and link/project.rs and link/session_link.rs import ts::ts_session::{entities::user_uid, ids}, the id and uid rule that the projection undoes the synthetic ids with (it moves to the engine side, or into voelin-model's replica conversion, which already has uid_text). |
11.3 Coordination
phase5/ui-vmaddscrates/voelin-ui-vmand moves UI logic (servers, settings) into it. Slice 1's model switch needs its manifest onvoelin-model.workspace = true; slice 3's API changes (identity blob,client_versionspec,ts::paths,QueryLogin) need compile fixes where that branch movedVoiceOptionsandObserveQueryconstruction. Mergephase5/ui-vmbefore slice 3, or plan the fixes on top of it.- Branches that still edit
crates/voelin-modelmust make those changes in VoelinProtocol after slice 1.
12. Risks
| Risk | Mitigation |
|---|---|
| A presence field gets lost between the two translations (a UI detail disappears). | Round-trip tests on the book fixtures and generated presences; F1-F10 listed; live smoke against the baseline. |
Event timing changes: Connected now follows three syncs and a JoinVoice; snapshots are coalesced. |
All in process for TeamSpeak (microseconds); the FakeLink tests pin the order; session.rs is unchanged. |
The inner bus of LinkSession lags and a request never gets its answer. |
Capacity 4096, a timeout on every pending request, lag logged. |
| The consumer of the push channel lags and stalls the voice and the commands that share the task. | The task never waits on the channel: what does not fit is dropped and the scope is sent again whole when there is room (14). |
A uid that round-trips through User.uid on one side and through Foreign on the other (F10) would key contacts and private history differently. |
Both sides use one rule (canonical base64 → bytes, anything else → Foreign), asserted by the round-trip test on TeamSpeak 3 and 6 uids, ServerQuery login names and the FakeLink fixtures' alice=; checked live (contacts and private history keyed by uid). |
| The model crate switch collides with other branches. | 11.3; the switch is manifest-only. |
| Two adapters cost CPU per voice packet (RTP wrap and unwrap in process). | About a hundred bytes copied per 20 ms per talker; measured in slice 1 by a unit test (a_voice_packet_costs_microseconds_through_both_adapters, section 13). |
13. Slice 1 as implemented
Slice 1 (the adapter, section 10) is in phase4/session-seam: step 1 is the
commit that takes voelin-model from the protocol repository, step 2 the
commit that puts the engine on the Session. session.rs is unchanged
(git diff 59fec5b -- crates/voelin-core/src/session.rs is empty), and no
public item was removed. Where the code differs from the text above:
- Files.
ts_sessionis a directory (mod.rswithLinkConnector,TsConnector,connect_paramsand theSessionimpl;driver.rs, the task that plays the host;entities.rs, the presence as v1 entities and its diff;ids.rs;media.rs, voice as RTP and back). The unit tests of the mapping arelink/tests.rs; the presence round trip is inbook.rs, next to the book fixtures.bytesis a direct dependency now (the RTP packets ofMediaPacket). LinkSessionis not generic. It holds the inner link as anArc<dyn ServerLink>;LinkConnector::new(link, schemes)andLinkConnector::any(link)are the generic part, andTsConnectoris aLinkConnectoroverTsLinkforts3serverandteamspeak.- The account-proof watches (
myts_identity,myts_data) travel inLocalCtx, from the engine'sLinkCtxto the connection, not inTsConnector(section 4.8):Engine::start_with_backendstakes a registry that is made before the engine exists, so the watches cannot be handed to a connector in it.LocalCtx::standalone()makes a context (with the watches' senders kept alive) for a connector called outside an engine; the plainConnector::connectofLinkConnectoruses it. OpenWritehands a connection, not a write half (BoxDuplex): the upload'sdonehas to see the server close it.UploadBodyreports the shutdown of the body todone, which then waits for the end of the connection (30 s at most), asfiles::uploadalways did.- Media and pushes have no order between them.
TalkingandAudiocome from the media queue (aMediaSinkthat never blocks),Poke,Chat,ErrorandPresencefrom the push channel, and the loop of SessionLink cannot order two channels: it polls the media queue before the pushes (the design text had the reverse), which makes a talker's packet reach the engine early when both are there, and that is all it does.TalkingandAudiotherefore have no defined order relative toPoke,Chat,ErrorandPresence, and the engine and its tests must not depend on one. (A packet from a slot the replica does not know yet fetches the queued pushes first and tries again, so a talker's first packet is not lost either way.) The first version of the fake-link test of presence playedAudio,PokeandErrorin one go and waited forTalking, the poke and the error in that order; it failed in 22 of 300 isolated runs, whenever the pushes were polled first. It waits forTalkingbefore it plays the rest now (5.4). - The stream task's reports wait for the engine's announcement. The
TeamSpeak 6 stream task puts
Event::StreamsChangedand the like on the engine's bus itself. Behind a session the engine learns of the connection only after the connect sequence (a few requests through the driver), while the stream task lists the server's streams as soon as the server tells it; a client that acts on the first list (voelinctl gateway --engine --watch-streamer, thedirectory_checkofscripts/it-smoke.sh) sentWatchStreambefore the engine knew it had voice, and failed withnot connected with voicein half of the runs (3 of 6; the baseline binary passed all 4 runs the server's clone limit did not end first, the two alternating on one TeamSpeak 6 server). The driver ofts_sessiontherefore holds the stream task's bus events back (Heldints_session/driver.rs; only for a link with streams, and only the events that are no answer to a request) until the engine's first stream command, whichsession.rssends in its handling ofConnectedright after it has emitted the state, or for 3 seconds. Three unit tests pin it (link/tests.rs: held until the first stream command, not held for ever, not held for a link without streams); the same probe passes 8 of 8 with it. - CHAT scopes are re-subscribed in full. The replica drops a scope's
cursor and entities when it is unsubscribed and refuses a delta sync
without a baseline, so SessionLink does not keep cursors for a delta
after moving back (section 4.3); the full sync repeats the window and the
engine's
seenset reports each(channel, id)once.LinkSessiondoes answerSubscribe.sinceof its own epoch with a delta. - Fixtures (section 5.4), beyond the builders listed there:
presence()gives the own client the unique id theConnectedevent names and the server the version of the backend; ina_replaced_connection_is_ignoredthe new connection's presence puts the own client in the lobby, where itsOwnChanneland its channel chat are (a TeamSpeak server delivers channel chat for the channel we are in only, section 4.3). In the book round trip a TeamSpeak 6 client with no streaming flag in the book comes back asSome(false)(v1 has no "unknown"). - Known limits. Two clients with one identity (one database id) are two
users of the replica (the own client keeps the database id, else the lower
client id; the other gets a user id made of its client id). A
Put Messagebefore any snapshot is handed to the link whatever the channel.Welcome.limitsis partly filled.Backendshas a slot for anAccountAgentand for aHostTrust(refusing by default); nothing sets either yet.
Follow-ups for the protocol repository, found while writing the code:
- P12.
FileEntry.from_pathshould say whether it includes the file's name. The TeamSpeak side reads it as the whole old path (/dir/name), withpathandnameof the entry the new place. - P13.
Signal{speaking}is for talking in channels the user is not in (protocol 5.6, 6.4). A host that hears a talker in our own channel and does not carry the voice as media (TeamSpeak's Speex and CELT talkers) has no way to say so but that signal, whichLinkSessionuses for them (SessionLink believes it untilon: false). The protocol should say that the signal may do this, or give such a talker a flag on theVoiceState. - P14. Say what a backend that reconnects inside a session (TeamSpeak's
tsclientlib) tells its consumer: today the participant id of the session changes without a word, and a consumer has to find itself again by its user. AChangethat puts the newVoiceStateand deletes the old one is all there is; the native session of H1 starts a new epoch instead.
What ran against the baseline (main 59fec5b; the dev servers of
dev/docker-compose.yml as the compose project voelin-seam, TeamSpeak
3.13.8 and 6.0.0-beta13.1):
| Check | Baseline | Adapter |
|---|---|---|
scripts/it-smoke.sh ts3 ts6, every per-server scenario (connect and tree, server and channel chat, voice tone, invisible presence, relay chat, gateway, history, pins and reactions, streams and late and elsewhere streams on TS6, the engine's voice features: file upload, link, list, download and delete; avatar; poke; private and offline messages; friend; blocked poke) |
all pass | all pass, the same output apart from counters and ids (the run before the fix of the stream reports, above, failed directory_check) |
the script's last stage, cargo test -p voelin-core --features media-desktop --test live --test stream_live --test media_live (parallel) |
5 pass, ts6_banners fails (4 HTTP requests where 0 are expected: another test's engine shares the mock server) |
the same |
live (serial, --test-threads=1) |
6 of 6 | 6 of 6 |
voice_features, stream_live, media_live (serial) |
3, 3, 2 pass | 3, 3, 2 pass |
cargo test -p voelin-core has two failures that exist on the baseline too
(discover::tests::without_records_the_gateway_itself_is_asked,
web::tests::pictures_go_through_the_proxy_named_for_each_hop: both reach a
server bound to 127.0.0.1 through the name localhost, which resolves to
::1 only on the machine the tests ran on; the modules are unchanged).
The CPU cost of the second adapter per voice packet (section 12) is measured
by the unit test a_voice_packet_costs_microseconds_through_both_adapters
(link/tests.rs): 5,000 Opus packets of 20 ms each way through both
adapters and the recording link, in a debug build, took about 7 microseconds
per packet to the host and 10 microseconds from it. At one talker that is
well under a tenth of a percent of a core; the test bounds each direction at
500 microseconds. tests/session_backends.rs adds two integration tests:
the engine over the protocol repository's FakeConnector through
Engine::start_with_backends (connect, the server's name, the channels, a
move, disconnect), and the registry's error text for an address no connector
serves.
14. Review round 2 of slice 1
The review of the first implementation found eight defects; each is fixed in its own place above and tested.
| Finding | Fix | Test |
|---|---|---|
Chat messages of a CHAT scope's initial full sync were lost when SyncBegin and Change were in one batch and SyncEnd in the next: (channel, id) was marked as reported before the replica could show the message. |
A message is marked as reported only when it was shown; at the SyncEnd of a CHAT scope the messages of that channel not shown yet are (4.3). |
the_messages_of_a_chat_sync_are_reported_when_the_sync_ends, a_message_that_comes_before_its_scope_is_reported_with_the_sync (link/session_link.rs) |
The own client id was pinned for the connection: after tsclientlib's reconnect (a new client id) OwnChannel and the own channel's chat stopped. |
Both sides find us again by our unique id and user (4.4); the own client keeps the database id of an identity that is there twice. | the_engine_follows_a_reconnect_that_makes_us_another_client, we_stay_the_client_we_were_while_it_is_there, the_own_client_keeps_the_database_id_of_an_identity_that_is_there_twice |
| CHAT subscriptions were capped at 16 in process: the 15th private peer's messages were never delivered. | LinkSession says 65,536; SessionLink sizes its scopes from Welcome.limits (16 only when the host says nothing), server chat and own channel first, newest private conversations next (4.3). |
private_messages_from_more_than_16_peers_all_arrive, the limits in the_welcome_names_the_host_the_user_and_what_the_link_can_do |
LinkSession::notify accepted List, FileRead and FileWrite and ignored them. |
A misplaced op is a Protocol error; any other op of the control stream is run (3.1). |
a_notify_needs_the_control_stream_and_is_run_as_the_request_it_is |
| A push channel that ended during the connect syncs threw the session's close reason away. | The reason of closed() is the reason of Disconnected (4.2). |
a_session_that_ends_during_the_connect_syncs_says_why |
LinkSession awaited pushes.send(): a lagging consumer stalled voice and commands. |
Nothing in the task waits: a push that finds the channel full is dropped, the scope is marked as lagged and sent again whole (SyncBegin..SyncEnd, all or none) when the channel has room, as ConnectParams.push_capacity documents; a scope bigger than the channel is sent in bigger chunks, so that it fits an empty channel. Signals have no scope: they are dropped. |
a_consumer_that_lags_loses_the_queue_and_gets_the_scope_again, a_scope_bigger_than_the_channel_is_sent_in_bigger_chunks |
An address no connector serves was echoed in full, with ?channelpassword=. |
The text cuts the address at ? and # (4.1). |
the_text_of_an_address_nobody_serves_keeps_the_channel_password_out, an_address_is_shown_without_its_secrets |
LinkEvent::Talking of the inner link was ignored, and its documentation unchanged: Speex and CELT talkers were no longer shown as talking. |
The docs of Talking, OwnChannel and Connected.own_client say what the adapter derives; the inner link's Talking goes on as Signal{speaking}, a hint that SessionLink believes until it is over (P13). |
a_talker_the_link_hears_but_does_not_forward_is_shown_as_talking, a_host_that_says_someone_talks_is_believed_until_it_says_otherwise |
15. Review round 3 of slice 1
The third review found seven defects (two major, five minor); each is fixed in its own commit, in its own place above, and tested. The tests that exercise the engine's behaviour fail on the code before the commit that fixes them.
| Finding | Fix | Test |
|---|---|---|
Major. presence_follows_the_link_until_it_disconnects failed in about 7 % of isolated runs (22 of 300 on the first implementation): Talking comes from the media queue, Poke and Error from the push channel, and the loop cannot order two channels; with the push polled first the wait for Talking swallowed the other two events and the next wait timed out. |
The test is the second changed test of the fixtures (5.4): it plays the voice packet, waits for Talking, and only then plays the poke and the error. Section 13 says that Talking and Audio have no defined order relative to Poke, Chat, Error and Presence (it had implied media first), 4.2 step 9 says the bias is no order, and 5.4 records the change of the test. |
the test itself: 0 failures in 300 isolated runs, and 0 in 40 runs of the whole link_fake binary |
Major. Driver::join answered a JoinVoice with the own voice state and sent no Move whenever the snapshot showed us in the channel: a second request back into the old channel, made while the first move was still on its way, was dropped without an error and the user stayed in the first move's channel. |
The shortcut stays for the first JoinVoice (the seat) and for a move into the channel we are in while no move of ours is pending; otherwise the request goes to the link in order. The link says nothing to a move into the channel it is in, so a refusal of the first move (JoinFailed) now settles the pending moves into the channel the snapshots show, instead of leaving them to the ten seconds (3.1). |
a_move_made_while_another_is_on_its_way_reaches_the_link, a_move_back_after_a_refused_move_is_answered_though_the_link_says_nothing |
Session::features() was never narrowed by Server.features (4.7 said it was). |
SessionLink keeps the host's set and the server's (Features::narrowed), recomputed when the SERVER scope changes or syncs and after a HostUpdate (4.7). |
the_features_of_a_server_are_the_hosts_narrowed_by_the_servers_list |
User-initiated file transfers got a 30 s negotiation deadline they never had (pictures had one, IMAGE_NEGOTIATION, and keep it in SessionLink). |
LinkSession waits for the link's OpenRead and OpenWrite without a deadline; a caller that drops the call is noticed through the closed reply channel and takes the inner job with it (3.1). |
a_transfer_waits_for_the_server_for_as_long_as_the_caller_does (virtual time) |
A poke from a sender with no unique id who is not on the snapshot lost its name (no User entity in LIVE for the synthetic client:N id). |
The driver puts a bare User with the name and no uid into LIVE for that id, replaced when the same client id comes back with another name (5.2). |
a_poke_from_a_sender_with_no_unique_id_outside_the_snapshot_is_named |
The ts3server:// round trip of address_link and inner_options changed what the link was given for odd bookmark addresses: a port that is no u16 was dropped silently, empty option strings became none, a bare host with a ? lost the channel. |
A port that is not a number from 1 to 65535 and a host that a link cannot carry (empty, ?, #, /, %, white space, an unclosed [) fail the connect in words (connect_params returns a Result); the remaining normalisations are listed in 4.2. |
a_bookmark_the_link_would_change_is_refused, the_bookmarks_a_server_has_come_back_with_their_channel, empty_options_come_back_as_none (ts_session/mod.rs), a_bookmark_with_a_port_that_is_no_port_does_not_connect |
One nightly rustfmt difference in link/tests.rs (.count() and == 3 on separate lines). |
The count is bound to a local, so both rustfmt versions format it alike. | cargo fmt stable (1.94) clean; nightly differs from the baseline's six diffs only (history.rs, encoder.rs, discovery.rs, chat.rs, studio.rs, engine.rs) |
What the fixes leave as it was: a move into the channel we are in, with none
pending, is still answered without asking the link (the baseline's link answered
it with nothing, so the user saw nothing either way), as 3.1 designed. One window
remains, where the baseline sent the Move: a move that the server made by
itself (a moderator moving the user) and that the snapshot has not shown yet
makes a JoinVoice into the channel the snapshot still shows a no-op, until the
snapshot catches up. The reviewer offered dropping the shortcut altogether; the
cost of that is the ten seconds a swallowed ChannelAlreadyIn leaves a request
waiting (and a request per click on the own channel), so it is kept for the
case where nothing is pending. And the 30 s ANSWER_TIME still bounds the
requests that are answered with data (file lists, deletes, offline messages),
which the baseline did not bound.
What ran
Checks of this round, on the head of the branch (Rust 1.94 and nightly 2026-10-19, in a nix shell with the native libraries; the baseline was not run again, the comparison with it is the table of section 13):
cargo fmton the own crates (scripts/own-crates.sh): clean on 1.94; nightly shows the baseline's six differences only. (cargo fmt --allon 1.94 rewrites the vendoredcrates/proto, which has a nightly-only style, so it is not the check.)cargo clippy $(scripts/own-crates.sh) --all-targets --locked --no-deps -- -D warnings: clean on 1.94. Nightly clippy reports five lints in code this branch did not touch (result_large_errofshutdown_connectioninvoice.rs, fourchunks_exactinaudio.rs) and none in the new code. Every commit of the round passes it on 1.94 alone.cargo test -p voelin-core --locked --no-fail-fast: everything passes on 1.94 and on nightly but the two tests that fail on the baseline too (discover::tests::without_records_the_gateway_itself_is_asked,web::tests::pictures_go_through_the_proxy_named_for_each_hop). The presence test oflink_fakepassed 300 isolated runs of 300 (22 failures of 300 with the test as it was), and the wholelink_fakebinary 40 of 40.cargo check --workspace --all-targets --lockedon 1.94 and on nightly (includesvoelin-ui,voelinctland the gateway binaries).- Live, against fresh dev servers (compose project
voelin-seam3, TeamSpeak 3.13.8 and 6.0.0-beta13.1):scripts/it-smoke.sh ts3 ts6, every per-server scenario passes; the script's last stage fails ints6_bannersonly (its assertion "disabled policy must prevent HTTP requests"), as it does on the baseline. Run by hand, serially:live6 of 6,media_live2,stream_live3,voice_features3 andvoelin-stream'slive_ts61 pass.
16. Slice 2 as implemented
Slice 2 (section 10: the tests on FakeSession and FakeHost, the conformance
suite, the TeamSpeak session tests) is in phase4/session-seam. It adds tests
and two small changes to the code under test, each found by a test, each in a
commit of its own (F1 and F2 in 16.5); a third finding (F3) is open, and a
fourth (F4) is an observation.
16.1 What was built
| File | What | Tests |
|---|---|---|
tests/session_fake.rs |
The engine through Engine::start_with_backends with a FakeConnector (scheme fake) and a FakeHost filled with put; FakeHandle plays the backend of one session. Public API only. |
16 run, 2 ignored (F3); 18 run since the review of slice 2 split two tests out (17.1) |
tests/link_fake.rs |
Trimmed to the three tests that need the inner link: the stream commands (stream_commands_reach_a_link_with_streams), the order of a reconnect's shutdown, a replaced connection that keeps talking. Slice 3 made the inner link crate-private and moved the file into the crate (src/link/fake_link_tests.rs, 17.1). |
3 |
src/link/fake_tests.rs |
What needs the crate's private parts: our voice as RTP read from sent_media, the voice of other slots, our own voice coming back, the conformance suite through Backends::connect. |
4 |
src/link/tests.rs |
One more test: a session made outside an engine keeps its watches open (F2). (Slice 3 replaced it: the connector owns the watches, 17.1.) | 1 |
src/ts/ts_session/live_tests.rs |
The TeamSpeak Session on both development servers (VOELIN_LIVE=1): the conformance subset and the session scenarios of 9.3. It raises the servers' anti-flood limits itself before the first connection (16.8). |
12 live, 2 ignored |
scripts/it-smoke.sh runs the live module before its engine stage.
The scenarios of link_fake.rs that moved:
Was in link_fake.rs |
Now | What is new in the version on the fake host |
|---|---|---|
presence_follows_the_link_until_it_disconnects |
presence_follows_the_host_until_it_ends |
the server's name and backend from Welcome, the tree from Channels with position, participants from VoiceStates and Users, talking from inject_media, the poke as a Signal, the notice as Error, the end as kill(Network(..)) |
commands_reach_the_link (minus streams) |
commands_reach_the_host_as_requests |
what the host received: Put{Message} (Markdown without chat.bbcode), JoinVoice with the password, the flags as notifications (id 0) patching one leaf path, Signal{poke}, List{FILE} (the fake refuses List.path, so the answer is scripted) |
a_sent_message_and_its_echo_are_one_message |
same name | the fake stores our Put and pushes its Change |
a_message_that_comes_twice_is_shown_once |
same name | four FakeHost::put(Message), one with MESSAGE_FLAG_RELAYED |
history_is_kept_across_the_connection |
history_is_kept_across_the_session |
a DM Channel{server_id: 0} in HOME, found through the other recipient's unique id |
New in session_fake.rs: how a session ends and the text the user reads (a
kick with a reason, an idle timeout, a close with no reason, the user's own
close as Local(Normal)); what a host refuses in its own words (message:,
poke:, PASSWORD, FULL, other, and a private message to nobody without a
request); closed scopes (a CHAT scope says nothing, a LIVE scope is an error
and an empty presence); a HostUpdate that removes files, so that the engine
refuses a file list without asking, and adds it and mailbox again; offline
messages as scripted Mail and the Put/Delete the host received; a file
written with write_file, read back with read_file, a missing file, and a
resumed upload that continues where the host's copy ends (the copy is left by
another session of the host that dropped its upload); CreateDirectory,
RenameFile and DeleteFiles as FileEntry puts and deletes; media routed to
the talker of its slot (an unknown slot, a whisper, 400 ms of silence); a
reconnect (the host sees the first session closed, the second has another
participant, a message said while away arrives, and the replay of the one
message seen is not shown again, because Dedup still holds it; every
replayed message is stored again, and one older than Dedup's 4 s is shown
again, which the two ignored tests of F3 pin); a connect that fails, and a
second that works.
16.2 The conformance suite
Through the registry. the_conformance_suite_passes_on_a_session_of_the_registry
runs the 17 cases of the protocol's suite (still 17, in the same order, at
c5bb6b9) against the FakeSession that
Backends::connect(params, LocalCtx::standalone()) hands over: 17 of 17
pass, none is skipped. The registry adds nothing to a plain connector's
session (host_uid is the connector's, there is no stream port), so the
request ids the host sees are the session's own (shared_request_ids).
Against TeamSpeak. ts3_conformance_subset and ts6_conformance_subset
open a TsConnector session per case on the development servers, and give the
suite the FakeHandle of an unrelated fake host as its backend. The verdict of
every case is asserted (2 pass, 4 skipped, 11 not run), and a case the suite
gains fails until it is listed in EXPECTED. The verdicts are the same on
TeamSpeak 3.13.8 and 6.0.0-beta13.1:
| Case | Verdict | Why (what the case did when it was run) |
|---|---|---|
welcome_matches_features |
passes | session only |
close_ends_the_session |
passes | session only: closed() is Local(Normal), later requests, notifications and media are Closed, the push channel ends |
a_stale_rev_conflicts_and_a_patch_writes_only_its_paths |
skipped | no chat.edit |
requests_apply_in_the_order_they_were_issued |
skipped | no chat.edit |
list_pages_history |
skipped | no chat.history |
idempotency_keys_apply_a_put_once |
skipped | no idempotency |
subscribe_syncs_the_scope |
cannot pass | writes to channel 4001: rejected (NotFound) no such channel |
subscribe_resumes_from_a_cursor |
cannot pass | channel 4002, the same |
put_answers_entities_and_pushes_the_change_with_the_same_rev |
cannot pass | channel 4003, the same |
delete_answers_an_ack_and_pushes_the_removal |
cannot pass | channel 4004, the same; and TeamSpeak cannot delete a message, where the case needs chat only (P8) |
a_key_names_an_entity_without_its_server |
cannot pass | server 4020: rejected (NotFound) no such server; and it creates a ScheduledEvent and an Emoji, which TeamSpeak lacks, though it needs no feature (P8) |
files_round_trip |
cannot pass | writes an AttachmentSlot: rejected (Unsupported) "attachments are not offered by this connection"; TeamSpeak has channel files, and the case needs files, not chat.attachments (P8) |
media_loops_back |
cannot pass | a TeamSpeak server does not return a client's own voice: the packet never loops back |
cancel_before_apply_is_cancelled |
cannot run | holds the unrelated fake host, so the request is answered while it "holds" |
notifications_are_fire_and_forget |
cannot run | reads the request log of the unrelated fake host: the notification never arrives (and it types into channel 1) |
renew_account_follows_the_feature |
cannot run | pushes a HostUpdate into the unrelated fake session's push channel, which is closed |
the_backend_can_end_the_session |
cannot run | kills the unrelated fake session, so closed() of the TeamSpeak session never resolves; and a kick is Network(text), not Remote{KICKED}, until H1 |
The cases that cannot pass or cannot run are not part of the default run: the
two ignored tests ts3_cases_that_do_not_apply_fail and
ts6_cases_that_do_not_apply_fail run each of them (with a step of 3 s) and
assert that it fails, printing the first line of the failure, so that a case
that starts to pass (with the native session of H1) is noticed. The table above
is what they printed.
16.3 The TeamSpeak session scenarios
Six live tests per server, on sessions that TsConnector made through the
plain Connector interface and that were driven the way section 4.2 drives a
session (list the server, subscribe HOME, SERVER and LIVE, take the seat, wait
for the LIVE scope to show it):
| Test | What it checks |
|---|---|
chat_in_the_own_channel |
Put Message in the channel both sessions are in is answered with the message as written; the other session gets the Change in its CHAT scope, ours gets the echo (the ids agree only with H1's native session, so only "not zero" is asserted) |
refused_moves |
with a Normal-group key and a locked and a full channel made through ServerQuery: JoinVoice without or with a wrong password is Rejected(PASSWORD), with the right one it seats us in that channel, a full channel is Rejected(FULL) |
poke_between_sessions |
Signal{poke} to the other participant reaches it as a Signal from our participant with the words |
voice_between_sessions |
five Opus frames and an end sent on our slot reach the other session's MediaSink on our slot, the first with the marker, the sequence counting up by one (it is TeamSpeak's packet id), the last an empty payload; media on a slot that is not ours is refused before it leaves |
channel_file_from_an_offset |
with a Server Admin key (guests may not upload): write_file of 3,000 bytes, read_file from offset 1,000 gives the file's size in the head and the bytes from the offset; the file is deleted afterwards |
conformance_subset |
16.2 |
16.4 Where the code differs from sections 9.2 and 9.3
- The CHAT re-subscription after moving back is a full sync, not a delta
(13):
the_chat_of_a_channel_is_resubscribed_when_we_move_backasserts twoSubscribes of the channel withoutsince, the missed message once, and the messages seen before not again. Theseenset ofSessionLinkdrops them, within the one connection, before the engine is asked about them: the test sends two of them 10 s apart, so thatDedup(4 s) no longer holds the older one and could not have dropped it. (With one message only the test passed without theseencheck as well, because the newest message seen is held byDeduptoo; with the check disabled the two-message test sees "before" again, 16.8.) - A reconnect resumes nothing (4.4): the second session is another session
of the same host, with a
SessionLinkand aseenset of its own.a_reconnect_finds_the_state_the_first_session_leftasserts what that gives (the state of the host, another participant, the first seat gone from the host, the first sessionLocal(Normal), the message said while away shown once). What it does not give is a clean replay: the host sends the window of the CHAT scope again, and every replayed message is stored a second time, and shown a second time unlessDedupstill holds an equal one (it holds the messages up to 4 s older than the last it was asked about). The one message that test sends before the disconnect is inside that window, so its replay is dropped. The two ignored tests of F3 (16.5) send two messages more than 4 s apart and pin both effects. - Our voice in
FakeHandle::sent_media()is a test ofSessionLink(link/fake_tests.rs): noCommandof the engine sends voice, the audio thread does. - The conformance run and the live TeamSpeak tests are in-crate:
Backends::connect,LocalCtxandTsConnectorare crate-private, and nothing was made public for a test. The live module runs withVOELIN_LIVE=1 cargo test -p voelin-core --lib ts_session::live_tests -- --test-threads=1. The servers must be the ones ofdev/docker-compose.yml(the module logs in to their ServerQuery asserveradmin) and may be freshly started: a server with its default anti-flood limits bans the address of the tests after three or four connections (ConnectFailedBanned), so the module raisesvirtualserver_antiflood_points_needed_ip_blockandvirtualserver_antiflood_points_needed_command_blockitself, once per server and run, and clears the bans of an earlier run (bandelall), asscripts/it-smoke.shdoes inadmin_args. It leaves the limits raised. Slice 3 makesTsConnectorpublic asvoelin_core::tsand can move them totests/. - The fake host does not model everything the scenarios use: it refuses
List.path(a file list and the listing before a resumed upload are scripted), stores noMailand noFileEntry(scripted), and its scripts take every request of their op, so a script is added after the connect, and the one forlistanswers by the kind asked. AHostUpdateor a notice has no event of its own: a test knows the engine has applied a push when the notice it sent after it is reported. welcome_matches_featuresandclose_ends_the_sessionpass for the right reason only since F2. Before it, a session made outside an engine ended by itself within a moment.
16.5 What the tests found
F1 (fixed, Drop the media that comes back on our own slot). A session
that loops our voice back made the engine hand our own packets to the audio
thread and show us as talking: the slot map holds every participant, ourselves
included. FakeSession loops media back by default, so that a test sees media
move; a Voelin host that did the same would have made the engine play us to
ourselves. on_media returns for the packets of our own slot. TeamSpeak never
sends a client its own voice, so nothing changes for the servers the engine
reaches. Test: our_own_voice_coming_back_is_not_played_back (it heard
[1, 50], us and then alice, before the change).
F2 (fixed, Keep the account watches of a session made outside an engine open). LocalCtx::standalone() exists to hold the senders of the
myTeamSpeak watches for a connector called outside an engine, but
connect_link dropped it when it returned; the TeamSpeak link ends its
connection with "account source closed" when a watch has no sender, so every
session made through the plain Connector interface ended by itself a moment
after it was handed out. The engine's path was never affected. The context
now moves into the driver task. Found by the first live run of the suite
(the_backend_can_end_the_session saw that text; close_ends_the_session had
passed without the session being alive). Test:
a_session_made_outside_an_engine_keeps_the_watches_of_its_link_open (fails
with "the identity watch lost its sender" without the change).
F3 (open; two ignored tests,
a_message_the_host_sends_again_after_a_reconnect_is_not_shown_again and
a_message_the_host_sends_again_after_a_reconnect_is_stored_once). After a
reconnect, a Voelin host sends the window of a CHAT scope again (the full sync
of 4.3), and the engine gets it wrong twice, in the store and on the display.
seen in SessionLink is per connection, so every message of the replay is
reported again; session.rs then stores each one (store_live, before
anything looks for a copy) and shows each one unless Dedup drops it.
- The store. The store merges copies from different sources only, so a
replay over the same source is a second row, whatever
Dedupdoes, andChatMessagedoes not carry the host's message id that would let it merge them. - The display.
Dedup(route.rs) recognises a copy only while an equal message (target, author, text, a timestamp within 2 s) is still held, and it holds the messages up to 4 s older than the last one it was asked about. A replayed message that is not equal to a held one is shown again as a liveEvent::Chat, like a new message: every message of the replayed window that is more than 4 s older than the newest message seen before the disconnect. The newest message, and what is within 4 s of it, is dropped.
The first version of the stored-once test sent one message before the
disconnect and looked at the rows only, and the display check of
a_reconnect_finds_the_state_the_first_session_left passed on that one message
because it is the newest one, so Dedup still held it: no test showed that the
display was wrong too. With two messages 10 s apart ("first" at t, "second"
at t + 10 s, then "while away" at t + 30 s said while the first session is
closed) the two tests see:
| Test | Expected | Seen |
|---|---|---|
..._is_not_shown_again |
the events ["while away"] |
["first", "while away"] ("second" is held and dropped, "first" is shown again) |
..._is_stored_once |
the rows ["first", "second", "while away"] |
["first", "first", "second", "second", "while away"] |
a_reconnect_finds_the_state_the_first_session_left stays in the default run
and proves only that a message inside Dedup's window is not shown again.
TeamSpeak never replays, and no voelin:// connector is registered, so no host
the engine reaches today meets this. Not fixed here because the cure is the
resume of H8, not a patch: a cursor kept per CHAT scope and sent as
Subscribe.since, which makes the reconnect a delta and cures both effects (the
replayed window is never sent), but only within an epoch: after an epoch change
the host sends a full sync again, and then only the host's message id can tell a
copy, in the store (H10) and on the display. The cheaper candidates each carry a
risk (a time floor per channel for the messages of a connect-time sync would
hide a backlog of a host that was restored with older clocks; keeping the
reported ids across connections would hide new messages of a host whose ids
restart; widening Dedup would hide a message said twice on purpose). The two
ignored tests are the acceptance tests of whatever is chosen.
F4 (observation). The first snapshot of the TeamSpeak link can come after
the session was handed out (the driver waits 250 ms for it, FIRST_SNAPSHOT),
so a consumer that subscribes at once gets an empty LIVE sync and the voice
states as changes after it, and the seat the first JoinVoice answers can
name channel 0. The engine's replica copes (it is built on changes); a
consumer that reads the seat's channel must wait for its VoiceState in LIVE,
as Client::settle in the live tests does. H1's native session should hold the
first sync back until it has the snapshot.
16.6 Follow-ups from this slice
For the protocol repository (workarounds as above):
| # | What | Workaround meanwhile |
|---|---|---|
| P15 | The suite's Fixture::backend is a FakeHandle for every harness, so a session of a real backend hands it an unrelated fake host and the cases that touch the backend fail or wait instead of being skipped. Make it Option<FakeHandle> and let a case say that it needs the backend (extends P8). |
EXPECTED in live_tests.rs names the cases to run. |
| P16 | Say whether a host sends a sender its own voice. FakeSession loops it back by default and media_loops_back pins that for the fake; a consumer cannot tell a rule of the protocol from a setting of the fake. |
F1: the engine drops its own slot. |
| P17 | Say what a consumer that reconnects without a resume token does with the replay of a CHAT window (protocol 2.5, 5.4): the Message id is the key to merge on, and Subscribe.since of a previous connection's cursor is a delta only within an epoch. |
F3: nothing yet (the replay is shown again and stored again). |
For the second half:
| # | What |
|---|---|
| H10 | CHAT cursors per session and address in SessionLink (or the SDK of H8), sent as Subscribe.since after a reconnect; then the two ignored tests of F3 run; the cursor cures the display and the store only within an epoch (16.5). For the full sync after an epoch change the host's message id also has to reach the store (or the store has to merge same-source copies by id) and the display. |
| H11 | The native TeamSpeak session of H1 holds the first sync back until it has the first snapshot (F4), and ts_session/live_tests.rs moves with ts_session to voelin-gateway-ts; its EXPECTED table is the conformance record of that crate. |
16.7 The broken translation
Acceptance asks for a deliberately broken translation that makes a
session_fake test fail. With the self_mute path dropped from
LinkCmd::SetInputMuted in link/session_link.rs (the line
self.voice_flag("self_mute", |voice| voice.self_mute = muted); removed, the
file restored afterwards), commands_reach_the_host_as_requests fails:
thread 'commands_reach_the_host_as_requests' panicked at .../voelin-proto/src/test_util/connector.rs:301:3:
timed out after 20s waiting for self_mute
16.8 What ran
Environment: Rust 1.94 (rust-toolchain.toml) and nightly 2026-10-19, in a
nix shell with gcc cmake gnumake pkg-config jq alsa-lib openssl libvpx dav1d pipewire fontconfig libxkbcommon. nix shell does not run the setup hooks, so
three things were added by hand: the .dev outputs of those libraries on
PKG_CONFIG_PATH (without them alsa-sys does not build), their lib
outputs on LD_LIBRARY_PATH (voelinctl needs libvpx.so.12), and
LIBCLANG_PATH with BINDGEN_EXTRA_CLANG_ARGS for libspa-sys. With that
cargo check --workspace --all-targets --locked passes on both toolchains. The
development servers were TeamSpeak 3.13.8 and 6.0.0-beta13.1 of
dev/docker-compose.yml (compose project voelin-seam5, reset with down -v
before each smoke run; the review round after the first version of this section
used voelin-fix2, reset the same way).
The review round (the corrections of F3, 16.1 and 16.4, the live module's
anti-flood step) ran on 1.94.1 and on the nightly that the store held then,
rustc 1.101.0-nightly (19833af72 2026-10-20): the nightly 2026-10-19 of the
first record was no longer there, so every nightly number below was measured
again on this one. The nix shell was the same set plus expat and the .dev
outputs of freetype and libxkbcommon; PKG_CONFIG_PATH took the .dev
outputs of all of them, LD_LIBRARY_PATH every output of every one of them
(the out output alone left libvpx.so.12 unfound for voelinctl), and
BINDGEN_EXTRA_CLANG_ARGS the include directories of glibc.dev and of
clang's resource directory.
| Check | Result |
|---|---|
cargo fmt $(scripts/own-crates.sh) -- --check |
clean on 1.94. Nightly 2026-10-20 (measured again in the review round): the six differences of the baseline, in the same six files (history.rs, encoder.rs, discovery.rs, chat.rs, studio.rs, engine.rs), none in a file of this slice. (cargo fmt --all on 1.94 rewrites the vendored crates/proto, so it is not the check.) |
cargo clippy $(scripts/own-crates.sh) --all-targets --locked --no-deps -- -D warnings |
clean on 1.94, voelin-ui and the binaries included. Nightly 2026-10-20 (measured again in the review round): -p voelin-core --all-targets gives the five lints of the baseline in code this slice did not touch (chunks_exact four times in audio.rs, result_large_err in voice.rs), none in the new code; over all own crates this nightly stops earlier, in voelin-audio and voelin-media, on lints that are new to it (chunks_exact and chunks_exact_mut with a constant chunk size, a manual checked division, sort_by_key) in two crates the slice did not touch. Every commit of the slice was checked alone on 1.94 (fmt, clippy, its tests); the first from an archive of its tree, the two code commits of the review round (81d1de8: the tests of 16.4 and 16.5; 9283191: the live module) from detached checkouts in this worktree (fmt of the own crates, clippy of voelin-core --all-targets, session_fake and link_fake), and the record of the round is a commit of this file only. |
cargo check --workspace --all-targets --locked |
passes on 1.94 and on nightly |
cargo test -p voelin-core --locked --no-fail-fast |
1.94: 236 lib tests pass, 2 are ignored (the live "do not apply" tests), 2 fail; the integration tests pass (session_fake 16 and 2 ignored, link_fake 3, session_backends 2, gateway 8, live 6, stream_live 3, voice_features 3, settings 1). Nightly 2026-10-20: the same integration tests, and 235 lib tests pass with 3 failures: the two below and identity::tests::improve_level_keeps_the_key once in seven runs (it passed in six reruns of the single test; it makes a random identity and asserts that the counter grew, which it does not when the key already has the level asked for, so a flake, though that cause was not confirmed; identity.rs is unchanged since 59fec5b). (Without --no-fail-fast the run stops at the lib's two baseline failures and the integration tests do not run.) The two failures are the baseline's (discover::tests::without_records_the_gateway_itself_is_asked, web::tests::pictures_go_through_the_proxy_named_for_each_hop: both reach a server bound to 127.0.0.1 through localhost, which resolves to ::1 here); they fail on an unchanged copy of bfc52e2 too. |
cargo test -p voelin-core --locked --features media-desktop |
(first version of this record; not rerun in the review round, which changed tests, the live module and this file only) the same, and a third failure, media::tests::peer_config_follows_codecs, which depends on the codecs of the machine and fails on the unchanged copy of bfc52e2 as well. (--features media alone does not compile the crate's tests: src/media.rs names voelin_media::ffmpeg, which only the desktop backends have; that is the baseline's.) |
link_fake and session_fake, 15 consecutive runs (again on the head of the review round, with the changed move-back test) |
0 failures (load average about 4; 9 at the last run of the review round) |
| Mutation (16.7) | commands_reach_the_host_as_requests fails with the self_mute path dropped; the file was restored |
Mutation (16.4), if self.seen.contains(&(channel, id)) in SessionLink::after made if false && ... |
the_chat_of_a_channel_is_resubscribed_when_we_move_back with its first version (one message seen before the move) still passes, and so does a_reconnect_finds_the_state_the_first_session_left: Dedup holds the newest message seen. With the two messages 10 s apart of the present version the test fails (left: "before", right: "while away"); the file was restored |
The two ignored tests of F3, cargo test -p voelin-core --test session_fake -- --include-ignored |
the other 16 pass; ..._is_not_shown_again sees ["first", "while away"], ..._is_stored_once sees ["first", "first", "second", "second", "while away"] (16.5); ten more runs of the two (-- --ignored): the same two values each time |
a_session_made_outside_an_engine_keeps_the_watches_of_its_link_open without the change of F2 |
fails ("the identity watch lost its sender") |
our_own_voice_coming_back_is_not_played_back without the change of F1 |
fails ([1, 50] heard) |
Live module, VOELIN_LIVE=1 cargo test -p voelin-core --lib ts_session::live_tests -- --test-threads=1 |
12 of 12 pass on both servers, in 16 s; three more serial runs and one parallel run the same; with --include-ignored the two ignored tests pass too, each non-applicable case failing as EXPECTED says (the output of 16.2) |
The same command on a freshly started stack (down -v, up -d, nothing else run before) |
Before the module raised the anti-flood limits itself: 4 passed, 8 failed (ts3 did not connect: session closed: Network("Server refused connection: ConnectFailedBanned"), the same for ts6). The module as it now is, run straight after that failing run (the ban still in force): 12 passed, 2 ignored. After a fresh reset: 12 passed, 2 ignored in 16 s, and 14 of 14 with --include-ignored in 51 s; after another reset, the same module in parallel (the default test threads): 12 passed, 2 ignored in 7 s, the tests that start together waiting for the one that raises the limits. Without that step the module passed only after scripts/it-smoke.sh had raised the limits (admin_args). banclear is refused by both servers (error id=256 command not found, read on TeamSpeak 3), bandelall is accepted by both. |
scripts/it-smoke.sh ts3 ts6 on an archive of bfc52e2 (before) |
every per-server scenario passes (connect and tree, server and channel chat, voice tone, invisible presence, relay chat, gateway, history, pins and reactions, the engine's voice features, and on TeamSpeak 6 the streams and the late and elsewhere streams); the last stage fails in ts6_banners (live.rs:375, "disabled policy must prevent HTTP requests"), as it does on 59fec5b |
scripts/it-smoke.sh ts3 ts6 at the head of the slice (after) |
the same output apart from ids and counters (compared line by line with the numbers and identifiers masked), plus the new stage of the live module (12 passed, 2 ignored); the last stage fails in ts6_banners at the same line |
scripts/it-smoke.sh ts3 ts6 in the review round, at 2089f7c (before) and at 9283191 (after), each on a freshly reset stack (COMPOSE_PROJECT_NAME=voelin-fix2, the state directory under the scratch directory) |
both: every per-server scenario of ts3 and ts6 passes, the live module stage gives 12 passed, 2 ignored (16.2 s before, 16.4 s after), and the last stage fails in ts6_banners at live.rs:375 (5 passed, 1 failed), the baseline's failure. The two outputs have 102 lines each and are equal once uids, stream ids, file names and counters are masked (the only residue is the random token in history-talker: offline-<token>). The review round changed tests, the live module and this file, so the smoke is unchanged by construction; it also shows that the raising of the limits in admin_args and the module's own coexist. |
the live binaries by hand, serially, on the head (--features media-desktop) |
live 6 of 6, media_live 2, stream_live 3, voice_features 3, voelin-stream's live_ts6 1: those of the baseline |
Not run: cargo deny (not installed in this environment; Cargo.lock and
THIRD_PARTY_NOTICES.md did not change, no dependency was added), the
Windows, Android and Flatpak builds.
17. Slice 3 as implemented
Slice 3 (section 10: the ServerLink layer where it is redundant, TeamSpeak
types out of the API) is in phase4/session-seam. The three non-blocking
minors of the review of slice 2 are in the first three commits, each of its
own; the slice itself follows, one commit per step, and every commit passes
cargo fmt and cargo clippy --all-targets --no-deps --locked -- -D warnings
alone (17.5).
17.1 What was done
| Commit | What |
|---|---|
dd9140e |
cases_that_do_not_apply_fail calls the_suite_is_known() first: a case the suite gains is no longer skipped by the zip with EXPECTED. |
b92379d |
The tail of a_reconnect_finds_the_state_the_first_session_left (a second ConnectVoice while connected replaces the session) is connecting_while_connected_replaces_the_session, and the end of commands_reach_the_host_as_requests (a host without streams is refused StartStream before any request) is a_host_without_streams_is_not_asked_for_one; the tests they were cut from check what their names say. session_fake runs 18 tests and ignores 2. |
362e2b9 |
presence_follows_the_host_until_it_ends asserts uid_of(client) of the three clients (the base32 of the Voelin uid, the host's name for each) and ServerDetails.uid. |
029b846 |
ts_link.rs, voice.rs, book.rs, ts_session/, versions.rs and identity.rs move under crates/voelin-core/src/ts/ with git mv (git log --follow reaches their history), and the commit changes only module declarations, use paths and the path of Versions.csv. voelin_core::versions and voelin_core::identity are voelin_core::ts::versions and voelin_core::ts::identity; the UI and voelinctl follow with the paths. (ts_session has been a directory since slice 1: section 10 wrote ts_session.rs.) |
a451f02 |
Command::SetMytsIdentity and SetMytsData are gone. ts::TsConnector is public, owns the account (TsConnector::set_myts_identity, set_myts_data; clones share it), and each connection holds the senders for as long as it runs, so a session outlives its connector (the F2 guarantee, now by construction: a_connection_keeps_the_account_open_when_its_link_is_gone in ts/ts_link.rs replaces the test of the standalone context's senders in link/tests.rs). Backends::register_teamspeak(TsConnector) is the public way to register a connector whose clone the application keeps; Backends::default registers one of its own. LinkCtx, LocalCtx, SessionHandle and Session lose the two watches. |
be84874 |
ObserveGateway.identity is a Box<IdentityBlob> and gateway::connect(url, &IdentityBlob) takes the blob: gateway.rs reads it itself, and a blob that is no TeamSpeak identity or cannot be read is ErrorCode::AuthFailed from connect and ends an observation with its reason, without a login (an_identity_that_cannot_be_read_ends_observing_without_a_login). ObserveQuery.connect is a Box<QueryLogin>, which query.rs turns into voelin_query::Connect (QueryTransport is the core's own enum). voelin_core::IdentityBlob re-exports voelin_identity::IdentityBlob, and ts::identity::{to_blob, from_blob} convert (IdentityError::Blob, whose text says where the JSON is wrong and never what it says). voelin-identity is a dependency of voelin-core: Cargo.lock gains that one edge. |
1edc52c |
VoiceOptions is a struct of its own (identity: Option<IdentityBlob>, client_version: Option<String>, stream_peer: PeerConfig, the rest as before). link/connect.rs builds the connect parameters (the bookmark's link, the hello, the credential of the identity's kind: a TeamSpeak identity as its JSON, none as the empty blob, a Voelin key as its signer, any other kind refused in words); the client version spec rides the address as client_version=<base64url of the spec> and ts_session::inner_options resolves it with ts::versions::resolve (a spec it refuses fails the connect). session.rs holds Arc<SessionLink>, the redundant trait between them is gone, and the trait that stays, ServerLink, is ts/ts_link.rs's (with the TeamSpeak-typed ConnectOptions) for TsLink and for the in-memory link of the tests. LinkCtx, LinkCmd, LinkEvent and Remote are pub(crate), TsLink is pub(crate), Engine::start_with_link is removed (not made private), and tests/link_fake.rs is src/link/fake_link_tests.rs (git mv), three unit tests on the same fake link through Engine::start_with_backends and LinkConnector::any. The module documentation of link/session_link.rs carries the contract of the vocabulary that link/mod.rs had. |
d70a358 |
voice.rs loses Download, Upload and CancelTransfer (the copying task, the progress cadence, the picture limits, the cancel table, expire_image_jobs); it keeps the two connection jobs OpenRead and OpenWrite and refuses the three commands in words. files::upload and its close wait go with it (SessionLink uses upload_to; the TCP test of the upload runs through that), and the test of image_download_time moves to cache.rs. The picture limits and the negotiation deadline are in SessionLink alone, tested in link/tests.rs as before. |
ca34f84 |
QueryLogin.allowlisted, see 17.2. |
f63d459 |
The crate's documentation builds with warnings denied: RUSTDOCFLAGS='-D warnings' cargo doc --no-deps -p voelin-core failed on efacb41 and on 59fec5b alike (eight errors, six with --features media-desktop: the cache's module documentation linked to private items, the crate documentation to modules and a type that exist only with the media features), so the acceptance check could not pass without it. Plain code spans now. |
d0092e4 |
docs/architecture.md: "The server link" is "The session seam", and the crate table row of voelin-core follows. |
No CHANGELOG.md entry: no difference to the baseline is visible to a user
(the UI still checks a bookmark's client version before it connects, and says
the same thing when the spec is none; QueryLogin runs the connection with
the options the UI always passed).
17.2 Where the code differs from the text of section 10
QueryLoginhas a seventh field,allowlisted. Section 10 lists transport, address, user, secret, server port and server id. The live tests (tests/live.rs:ts3_engine,ts6_engine) have always passedvoelin_query::ConnectwithLineOptions::rate_limit: None, because the development servers allowlist their clients; the UI never did, it passed the query crate's default (nine commands in three seconds). With the six fields the engine's connections can only have the default limit, and both tests failed on the first run after the slice (timed out waiting for relayed channel message; the limit is the one difference between that run and the baseline, and with the bit below the tests pass again, so the relay's connect is slower than the two seconds the test gives it, behind the limit; that was not investigated further).allowlistedis that one bit:falseis what the application says (it cannot know) and what the UI's login says, so the application's connections are the ones they were; the tests saytrue.ServerLinkis not made crate-private, it is moved: the engine side needs no trait (session.rsholdsSessionLink), andSessionLinkandTsLinkcould not share onespawnany more, as the options of the one are neutral and the options of the other havetsclientlibtypes. The trait ists/ts_link.rs's, as the TeamSpeak module "keeps the inner trait".- The setters are reachable through
Backends::register_teamspeak, which section 10 did not name: a public setter that nothing could reach would have been a dead end. files::uploadandCLOSE_WAITare deleted (section 10 does not say):voice.rswas their only user.- The acceptance
rghas to be run fromcrates/voelin-core/src: its glob!ts/**is relative to the directory it runs in. From the repository root,--glob '!**/ts/**'does the same. - The bookmark-refusal tests that exercise
link/connect.rs(a_bookmark_the_link_would_change_is_refused,the_bookmarks_a_server_has_come_back_with_their_channel,the_params_carry_what_the_session_needs_and_no_account_yet) still sit ints/ts_session/mod.rs, where they were written, next to the round trip they were part of; moving them is a tidy for later (17.6).
17.3 What phase5/ui-vm-2 has to absorb
The parked branch is not touched. Every change of this slice that reaches an
application that builds VoiceOptions, the gateway and query commands or the
TeamSpeak helpers:
VoiceOptionsis no alias ofConnectOptionsany more (voelin_core::ConnectOptionsandvoelin_core::link::ConnectOptionsare gone,VoiceOptionsisvoelin_core::VoiceOptions):identityisOption<IdentityBlob>(wasOption<tsclientlib::Identity>;voelin_core::ts::identity::to_blob(&identity)),client_versionisOption<String>, the spec forts::versions::resolvethat a bookmark stores (wasOption<tsclientlib::Version>; keep the eagerresolvefor the message and pass the spec string),stream_peerisPeerConfigas before; the other fields are unchanged.Command::SetMytsIdentityandCommand::SetMytsDataare removed: the account goes to theTsConnectorthe application registered (Backends::register_teamspeak,TsConnector::set_myts_identity,set_myts_data,Engine::start_with_backends).Command::ObserveGateway.identityisBox<IdentityBlob>(wasBox<tsclientlib::Identity>);gateway::connect(url, &IdentityBlob)(was&tsclientlib::Identity).Command::ObserveQuery.connectisBox<QueryLogin>(wasBox<voelin_query::Connect>):transport: QueryTransport(Raw,Ssh,Http),address(wasaddr),user,secret,server_port,server_id,allowlisted(false); there is noline.voelin_core::versionsandvoelin_core::identityarevoelin_core::ts::versionsandvoelin_core::ts::identity;ts::identity::{to_blob, from_blob}are new,IdentityErrorhas aBlobvariant.voelin_core::IdentityBlobre-exports the protocol repository's type.- No longer public:
ServerLink,TsLink,Engine::start_with_link,link::{LinkCtx, LinkCmd, LinkEvent, Remote}and the helper types oflinkthat came with them (BoxRead,BoxDuplex,Duplex).voelin_core::linkkeepsBackendsandVoiceOptions. voelin_core::ts::TsConnectoris public, withnew,set_myts_identityandset_myts_data.
17.4 The acceptance list of section 10
| Item | Result |
|---|---|
rg -n 'tsclientlib|tsproto|voelin_query' over crates/voelin-core/src without ts/, gateway.rs, query.rs and stream.rs |
empty (from crates/voelin-core/src, --glob '!ts/**' --glob '!gateway.rs' --glob '!query.rs' --glob '!stream.rs'). The four exceptions name the crates privately: gateway.rs in login_identity, connect_watched, attempt and the tests, query.rs in QueryLogin::connect and run, stream.rs in a private use tsclientlib::ClientId, and ts/ is the module. |
session.rs names no TeamSpeak crate |
none of tsclientlib, tsproto, voelin_query occurs in it. |
No public item outside voelin_core::ts names a type of tsclientlib, tsproto* or voelin-query |
Checked on the rustdoc JSON of the crate (nightly: RUSTDOCFLAGS='-Z unstable-options --output-format json' cargo doc --no-deps -p voelin-core --features media-desktop), walking every item the crate exports (5,198 of them): every type reference whose crate is tsclientlib, tsproto, tsproto_packets, tsproto_types, tsproto_structs, ts_bookkeeping or voelin_query is in an item of voelin_core::ts (11 items: to_blob, from_blob, export, write_export, improve_level, Found::identity, resolve, native_version, KnownVersion::to_version and the two setters of TsConnector); none is anywhere else. The grep of pub items (rg '^\s*pub(\(crate\))? .*(tsclientlib|tsproto|voelin_query)' over the crate without ts/) is empty, too. |
voelin_core::stream keeps the re-exports |
PeerConfig, MediaFrame, MediaKind, MediaTime, Frequency, VideoFormat, VideoCodec, Codec, FrameSource, SyntheticSource are re-exported as before (stream.rs changed in one doc comment). |
cargo tree -p voelin-core -e normal | grep -E 'tsclientlib|tsproto' |
still lists tsclientlib, tsproto, tsproto-packets and tsproto-types, as the section says it may: the TeamSpeak module is in the crate. |
| The three review minors | dd9140e, b92379d, 362e2b9. |
17.5 What ran
Environment: Rust 1.94.1 (rust-toolchain.toml) and the nightly of the Nix
store, rustc 1.101.0-nightly (19833af72 2026-10-20). The development shell
dev rust-nightly does not build here (cargo-llvm-cov fails), so both
toolchains were taken from the store paths and put in front of PATH in a
nix shell of gcc cmake gnumake pkg-config jq and the .dev outputs of
alsa-lib openssl libvpx dav1d pipewire fontconfig freetype libxkbcommon expat; nix shell runs no setup hooks, so PKG_CONFIG_PATH (the .dev
outputs), LD_LIBRARY_PATH (every output of those libraries; voelinctl
needs libvpx.so.12), LIBCLANG_PATH and BINDGEN_EXTRA_CLANG_ARGS
(glibc.dev's and clang's include directories) were set by hand. With that
cargo check --workspace --all-targets --locked passes on both toolchains,
voelin-ui, voelinctl, voelin-android and the gateway binaries included.
cargo-about 0.9.2, which scripts/notices.sh insists on (nixpkgs has
0.9.0), was installed with cargo install under the scratch directory, and
the TeamSpeak 3.13.8 and 6.0.0-beta13.1 servers of dev/docker-compose.yml
were fresh compose projects (down -v, up -d) for each smoke run.
| Check | Result |
|---|---|
cargo fmt $(scripts/own-crates.sh) -- --check |
clean on 1.94. Nightly: the six files of the baseline and no other (voelin-core/src/history.rs, voelin-media/src/ffmpeg/encoder.rs, voelin-stream/src/discovery.rs, voelin-ui/src/chat.rs, voelin-ui/src/studio.rs, tools/voelinctl/src/engine.rs). cargo fmt --all -- --check on 1.94 differs in the vendored crates/proto only, as it did before (it has a nightly-only style), so it is not the check. |
cargo clippy $(scripts/own-crates.sh) --all-targets --no-deps --locked -- -D warnings |
clean on 1.94 at the head. Every code commit of the slice alone (dd9140e to f63d459, ten of them) was checked out detached in this worktree and passes fmt and clippy: voelin-core for the commits that touch tests only, all own crates for the ones that touch the UI or voelinctl. Without --no-deps, the command of the task (cargo clippy -p voelin-core --all-targets --locked -- -D warnings) stops at the vendored tsproto-structs (eight lints) on efacb41 and on the head alike. Nightly, -p voelin-core --all-targets: result_large_err of shutdown_connection (now in ts/voice.rs, the same code) and the chunks_exact lints of audio.rs that the baseline gave, none in new code. |
cargo test -p voelin-core --locked --no-fail-fast |
1.94: 244 lib tests pass, 2 are ignored (the live "do not apply" tests), 2 fail, both the baseline's (discover::tests::without_records_the_gateway_itself_is_asked and web::tests::pictures_go_through_the_proxy_named_for_each_hop: localhost resolves to ::1 here); the integration tests pass (gateway 9, session_fake 18 and 2 ignored, session_backends 2, settings 1, stream_live 3, voice_features 3, live 6, which return at once without VOELIN_LIVE). Nightly: the same numbers. With --features media-desktop on 1.94: 264 pass, three fail (the two and media::tests::peer_config_follows_codecs, which depends on the machine's codecs and failed on the baseline too). cargo test -p voelin-ui -p voelinctl: 134 and 7 pass. |
| Repeated runs (1.94) | session_fake and the three tests of link/fake_link_tests.rs: 15 runs each, 0 failures; the --lib suite: 8 full runs. session::banner_tests::a_failing_banner_is_logged_once_with_its_address failed once in a full --lib run before the last commits (lines == [], the test reads the log lines of its own thread with tracing::subscriber::with_default) and passed in every run since and in five isolated ones; it was not reproduced and not chased (a module this slice did not touch, a test that depends on a global callsite cache). |
RUSTDOCFLAGS='-D warnings' cargo doc --no-deps -p voelin-core |
passes, with and without --features media-desktop (it failed on efacb41, 17.1). |
scripts/notices.sh --check (cargo-about 0.9.2) |
THIRD_PARTY_NOTICES.md is up to date: Cargo.lock gained one line, the edge from voelin-core to voelin-identity, a crate already in the graph through voelin-store. cargo deny is not installed here. |
scripts/it-smoke.sh ts3 ts6, every per-server scenario |
the baseline (efacb41) and the head both pass them all (connect and tree, server and channel chat, voice tone, invisible presence, relay chat, gateway, history, pins and reactions, the engine's voice features, on TeamSpeak 6 the streams and the late and elsewhere ones). The outputs have 100 lines each and are equal line by line with the digits, base64 runs, uuids and ids masked, but for the random uid of the streamer in the stream-directory line. |
| The script's live module stage | 12 passed, 2 ignored on both (16.35 s before, 16.36 s after); --include-ignored at the head: 14 of 14 in 47 s (the two "do not apply" tests call the_suite_is_known first now). |
The script's last stage (live, stream_live, media_live, in parallel) |
both: 5 passed, 1 failed, ts6_banners ("disabled policy must prevent HTTP requests"), the baseline's failure. The line is live.rs:375 before and live.rs:396 after: the file grew by 21 lines in the slice (the login helper and its imports, 17.2), the assertion is the same. |
The live binaries by hand, serially, --features media-desktop |
before and after alike: live 6 of 6 (73.40 s, 73.39 s), media_live 2, stream_live 3, voice_features 3, voelin-stream's live_ts6 1. |
The first smoke run after the slice (head d70a358, before ca34f84) |
live failed ts3_engine and ts6_engine (17.2: QueryLogin without allowlisted); it is not part of the comparison above, which is the second run on a freshly reset stack. |
17.6 Follow-ups
-
H9 starts from the complete edge list below. The Opus gate of the merge (2026-10-24) found that 11.2 names two edges and the tree has more. Each line was checked with
rgandcargo treeon the tree of the follow-up round (phase4/seam-followups); file lines are given where the file did not change in the round, items by name where it did.-
From the engine into
src/ts/: what has to be cut or moved beforetscan leave the crate.Where What Goes with link/backends.rsuse crate::ts::TsConnector;Backends::defaultregistersTsConnector::new();Backends::register_teamspeak(TsConnector)is the only public way to register an in-process connector and goes through the crate-privateregister_local(Arc<dyn LocalConnector>)H9: the tsfeature makesdefaultoptionallink/project.rs:20-21,link/session_link.rs:565, 973, 1328ts::ts_session::entities::user_uidandts::ts_session::ids::{self, FOREIGN_SYSTEM}: the id and uid rule the projection undoes the synthetic ids withH9: to the engine side, or into voelin-model's replica conversion (uid_text)gateway.rs:98, 1209ts::identity::{from_blob, to_blob}: 98 islogin_identity(the blob to thetsclientlib::Identitythe gateway login is made of), 1209 is a testH5: the gateway becomes a Sessionand takes the blob as a credentiallib.rs:69pub mod ts: the public pathsvoelin_core::ts::{identity, versions, TsConnector}H9: they move or are re-exported outside the crate: tools/voelinctl/src/{engine,identity,versions,client}.rs,crates/voelin-ui/src/{app,servers}.rsandsettings_pages/bind.rs,crates/voelin-ui-vm/src/settings_pages/logic.rs,crates/voelin-core/tests/gateway.rsusers of voelin_core::ts::identity::*andts::versions::*(to_blob,Found,import,import_new,discover,read,write_export,improve_level,LaunchImport,DEFAULT_NICKNAME,resolve,native_version,known_versions,client_metadata)H9: re-point to the new crate ( crates/voelin-ui*belong tophase5/ui-vm-2)docs: lib.rs:8(ts::TsConnector),lib.rs:129(Command::ObserveGateway:ts::identity::to_blob),gateway.rs:103(to_blob),settings.rs:1138(import_new); inlink/mod.rsthe module doc (TsConnector),VoiceOptions::identity(to_blob) andVoiceOptions::client_version(ts::versions::resolve)intra-doc links into ts, whichcargo docwith-D warningsresolves only whiletsis in the crateH9: reworded, or pointed at the new crate's docs A TeamSpeak connector in another crate has only
Backends::register(Arc<dyn Connector>):register_teamspeaktakes the crate's ownTsConnector, andLocalConnector,LocalCtx,LocalConnectedandStreamPortare crate-private. A plainConnectoris handed neither theLocalCtx(the event bus,audio,stream_peer) nor aStreamPort(Backends::connectmakes itsLocalConnectedwithstreams: None), so its sessions have no TeamSpeak 6 streams. Streams across the crate boundary need H2 first, or a public extension trait that takes the place ofLocalConnector.Test-only edges, which move with the tests of each side:
link/tests.rsandlink/fake_link_tests.rs(lines 30-31 of both) usets::ts_session::LinkConnectorandts::{ConnectOptions, ServerLink}; the tests oflink/session_link.rsusets_session::{backend_to_v1, features_of};link/tests.rsuses the helpersts::identity::{json_with_a_cut_key, assert_holds_no_piece_of}andtests/session_fake.rsbuilds atsclientlib::Identityand runsBackends::default()in one test (both from this round, with the gate's minor). -
From
src/ts/into engine-private items: the reverse edges.Module of the engine Items src/ts/usescrate::linkLinkCmd,LinkEvent,LinkCtx(itssession,events,frames,settings,emit,done),Remote,BoxRead,BoxDuplex(ts/voice.rs,ts/ts_link.rs,ts/ts_session/driver.rs);LocalConnector,LocalCtx,LocalConnected,StreamPort,VERSION_PARAM,without_query(ts/ts_session/mod.rs);StreamEvent(driver.rs)crate::streamStreamCmd(voice.rs,driver.rs),StreamHandle,StreamInput(voice.rs)crate::filesFileEntry,RequestId,TransferState, and the functionsnormalize_dirandjoin_path(voice.rs,driver.rs)crate::offlineOfflineMessage,OfflineMessageInfo(voice.rs,driver.rs)the crate root Event,JoinFailure,BackendInfo,POKE_MESSAGE_MAXcrate::settingsSharedSettings, throughLinkCtx.settings, whichvoice.rshands to the stream tasktests only crate::link::{Backends, VoiceOptions, connect_params}(ts_session/mod.rs,live_tests.rs),crate::link::media::TalkTrackerandcrate::link::project::{View, presence}(ts/book.rs),crate::settings::{SharedSettings, Settings}andcrate::files::{Report, Sink}(ts/voice.rs)Together with the first list this is a cycle:
voelin-corewould needvoelin-gateway-tsforTsConnectorand the uid rule, andvoelin-gateway-tsneedsvoelin-corefor every item above. So the "by git tag" step of H9 needs H1 and H2 (the TeamSpeak side speaks v1 throughSession, which takes the place ofLinkCmd,LinkEvent,LinkCtx,StreamPortand the stream task's input) or a shared vocabulary crate that holds the items above for both sides. Without one of the two, only the first step, thetsfeature ofvoelin-core, is possible. -
What else keeps
tsclientlibandtsprotoin the tree. The exit check (cargo tree -p voelin-core -e normal | grep -E 'tsclientlib|tsproto'empty) is not met by movingsrc/ts/alone:voelin-coreitself: its four direct dependencies (tsclientlib,tsproto,tsproto-packets,tsproto-types) leave withsrc/ts/, butgateway.rsusestsclientlib::Identity(login_identity,connect_watched,attempt: H5) andstream.rsusestsclientlib::ClientId(item 4).- Three more crates of
voelin-core's tree carry the dependency:voelin-store(store.rsandkeystore.rstake, read and check atsclientlib::Identity),voelin-stream(proto.rs,session.rs,discovery.rs:tsclientlib::{ClientId, InMessage, messages::c2s}andtsproto_packets::packets::OutCommand; H3 splits it) andvoelin-gateway-proto(auth.rs,client.rs:tsproto_types::crypto::EccKeyPrivP256, the key of the gateway login; H5).cargo tree -p <crate> -e normalshows it for each of the three. voelin-queryandvoelin-observerhave none, soquery.rsusingvoelin_queryis not an edge of the exit check; it goes with H5 because the query observer becomes aSessionof a gateway daemon.- So the exit check needs H1-H3, H5, a way for
voelin-storeto handle a TeamSpeak identity withouttsclientlib's type, and H9.
-
stream.rsmust be split. Stays with the engine:StreamState,WatchState,StreamFrame,StreamSinkandLayerFormat(public API),StreamCmd,OwnStreamEvent,kind_name,parse_kindandparse_srtp_profiles(session.rs),media_codec(media.rs) and the re-exports ofstream_types(StreamInfo,StreamKind,StreamSetup,ViewerInfo, ...). Goes with the TeamSpeak 6 task:StreamHandle,StreamTaskand its helpers,StreamInput, theStreamLookupover the gateway directory, and every use oftsclientlib::ClientId(the engine's own ids areu16;stream.rswraps them forvoelin-stream). -
The engine API docs that link into
tsmove with it (the last row of the table of item 1):VoiceOptions::identityandCommand::ObserveGatewaylinkts::identity::to_blob,VoiceOptions::client_versionlinksts::versions::resolve.
-
-
The key store follows task 34 (
phase4/keystore-task34). Open question 10 of the accounts design (answered by the owner on 2026-10-24) madeKeyStore::sign_outkeep every device key, and VoelinProtocolmain(c5bb6b9) has it.SqliteKeyStoreruns that trait method, so the follow-up that Phase 2 task 34 leaves to this repository ("Note for VoelinClient") is the pin of the three protocol crates, the tests that asserted the deletion of a key made for the account (now kept, unbound, byte for byte; onlyDeviceKeyChoice::Forgetdeletes a key of the device), and the documents:keystore.rsanddocs/architecture.md, "Identities", which has the three parts of the question and the duties of the GPUI client (the sign-out dialog's wording with "Forget this device's identity" and an export first, the release in Settings → Account, and the delete-account dialog, which warns that the account's servers become unreachable and offers an export of the device keys first). A sign-out still deletes the synced copies and the account record, soSignOutPassstays for their one checkpoint, and the refusal of a device key stored as a synced copy stays, with its reason reworded: the sign-out keeps the key but deletes every synced copy before it reads the record. The store gained no release call and no "released" record:AccountClient::releaseends insign_outwithAuto, and the design asks the client to remember nothing of a release. A note for VoelinProtocol, not fixed here: when the device key's own row carries a device-only binding, the trait's providedsign_outlists the key twice inSignOut.unbound(once in its loop over the identities bound to the account, once in theAutobranch), which the tests of this repository do not mind (they usecontains) and which is a follow-up for the protocol repository. -
The same leak in
voelin-store, closed inphase4/keystore-task34.Store::identityandStore::identitiesread the stored JSON of a TeamSpeak identity with?, so anError::Jsonwhose text is theserde_jsonmessage, which quotes a key that does not import, as the gate's minor did in the connector. The rows are written from atsclientlib::Identity(add_identity), so a damaged database is the only way to such a row.ts::identity::from_jsoncannot be used there (voelin-coredepends onvoelin-store), so the same classification is invoelin-store(identity_from_json): the newError::Identity { damage, line, column }says malformed, cut short, not an identity or unreadable (IdentityDamage), and where, and never the text. The key store (keystore.rs) was checked line by line and does not leak:check_teamspeakandColumns::leveldrop the parse error (let Ok(..) elseandmap_or), and the binding warning names the row's kind and uid, not its data. A test with six damaged rows (a key that does not import, a field of the wrong type, syntax, a cut text, bytes that are no UTF-8 as a BLOB and as TEXT) calls everything of the store and of the key store that reads or writes the row and looks through the errors (text,Debugand sources) and the logs at TRACE for any 8 characters in a row of what the row held (crates/voelin-store/tests/identity_text.rs); it fails with the reader's message put back. -
The bookmark tests of
link/connect.rsthat still sit ints/ts_session/mod.rs(17.2) belong next to it. -
QueryLogin.allowlistedgoes with the query observer (H5), which becomes aSessionof a gateway daemon. -
Backends::default()keeps itsTsConnectorto itself: an application that sets the myTeamSpeak account builds its registry (Backends::emptyandregister_teamspeak) and starts the engine withstart_with_backends. The account goes throughAccountAgentwith H4. -
Documents that still name the old paths and are not this slice's to change: the comment of
voelin-store(voelin_core::identity, a crate other branches own) anddocs/research/ui-review.md(research notes with line numbers ofvoice.rs).
17.7 The round after the review of slice 3
The review of slice 3 left four minors. This round closes them, one commit
each, and brings the branch onto main (ad20979), so that the tree the gate
judges is the tree that will be merged. No history was rewritten.
| Commit | What |
|---|---|
e13d401 |
Merge of main (ad20979, 13 commits: the merge of phase5/ui-vm, the toolkit-free crates/voelin-ui-vm and the logic/bind split of crates/voelin-ui), see below. |
87926e9 |
Minor 1. link::connect::credential refuses a TeamSpeak IdentityBlob whose JSON is empty (or only white space) with SessionError::Protocol("the TeamSpeak identity cannot be read: it is empty"), before any connector is asked: sent as it was, it was the empty Credential::Foreign blob that the TeamSpeak connector reads as "make an identity up", which only identity: None may ask for. Two tests: link::connect::tests::a_teamspeak_identity_without_json_is_refused ("" and " \n\t" are refused, none is still the empty blob) and, through the engine on the fake host, a_teamspeak_identity_without_json_is_refused_and_no_session_is_made (ConnectVoice ends in Disconnected with the error voice: the TeamSpeak identity cannot be read: it is empty; the connector's connects() is empty and last_session() is None; a connect without identity works afterwards). Both fail with the check switched off. The comment of ts::identity::to_blob ("a blob with no JSON is refused when it is used, in words") is unchanged and holds on both paths now: the gateway's from_blob always refused it (ObserveGateway ends with its reason, without a login). |
f0d20cc |
Minor 2. QueryLogin.transport has its doc comment, the only public field of the type without one. |
76a884a |
Minor 3. 4.1 (the TsConnector owns the myTeamSpeak account since a451f02; it is not registered "with the engine's watches"), the 16.1 table (src/ts/ts_session/live_tests.rs), the section 10 acceptance rg (given as run from the repository root, --glob '!**/ts/**', and the glob it takes from crates/voelin-core/src), the module documentation of ts/voice.rs (it linked crate::TsLink, which is ts::ts_link::TsLink and crate-private), link/tests.rs (ts/ts_session/driver.rs), the comment on IdentityOrigin::Imported in voelin-store (voelin_core::ts::identity; one word, the crate is otherwise untouched) and docs/research/ui-review.md (ts/voice.rs; the line number of the channel subscription, which has moved twice since the note was written, is replaced by where the code is). One more of the same kind that the list did not name: docs/audio.md named voelin-core/src/link.rs for LinkCmd::Audio, which is link/mod.rs. |
f1df886 |
Minor 4. ts::voice::Voice::command answered LinkCmd::Download, Upload and CancelTransfer with anyhow::bail!. The commit message and the slice 3 review said that this ends the whole TeamSpeak connection; it does not: the Input::Cmd arm of ts/voice.rs catches the error and sends it as LinkEvent::Error, which the driver turns into an error notice, and only an Input::Item error breaks the loop. What really happened before the change was one spurious error notice and a transfer whose report was never answered, so the transfer hung (the review of this round corrected the record). Download and Upload now answer their report with TransferState::Failed("this link does not run transfers itself") and the connection goes on; CancelTransfer has no report and nothing to cancel, and is logged at debug. (Making the variants unrepresentable for the inner link would mean a second command enum next to LinkCmd; the match arm is smaller.) Test: ts::voice::account_tests::a_transfer_command_fails_the_transfer_and_not_the_connection gives an unconnected Voice the three commands: each returns Ok, the two reports see exactly the Failed, nothing is pending. |
The merge. Three conflicts:
crates/voelin-ui/src/settings_pages.rs(modify/delete):mainsplit it intosettings_pages/{mod,bind}.rsandvoelin-ui-vm'ssettings_pages/logic.rs; this branch had only changed its sixvoelin_core::identity::paths. The file is deleted, and the six paths arevoelin_core::ts::identity::where the code now is (five inbind.rs,Foundinlogic.rs; the import moves in its group, asrustfmtorders it).crates/voelin-ui/src/identities.rs: the module comment, which namesvoelin_core::ts::identity::import_new(this branch) andsettings_pages/(main).docs/architecture.md: thevoelin-corerow of this branch with thevoelin-ui-vmandvoelin-uirows ofmain.
Not conflicts, but needed to compile: voelin-ui-vm named the in-tree
voelin-model by path, which fb8e6b6 (an early commit of the branch) had taken out of the
workspace for the protocol repository's (voelin-model = { workspace = true }
now). Nothing else of voelin-ui-vm or of voelin-ui's new bind modules
touched a type of this slice: VoiceOptions, ObserveGateway, ObserveQuery
and the removed commands are only built in voelin-ui/src/servers.rs, which
merged on its own and compiles (17.3's list is absorbed with these two
changes). Cargo.lock, Cargo.toml, README.md, docs/ui.md,
crates/voelin-ui/Cargo.toml, app.rs and servers.rs merged without a
conflict: the lock resolves with --locked, and its difference to main's is
the branch's alone (the edges of voelin-core to voelin-identity and
voelin-proto, the revision of the three protocol crates that the branch
pinned (since moved to c5bb6b9 by task 34), and
voelin-model as a git package). CHANGELOG.md is main's entry
(voelin-ui-vm); the branch adds none (17.1), and still needs none: nothing
of this round is visible to a user.
What ran. Same environment as 17.5, taken again: the toolchains from the
store paths in front of PATH in a nix shell of gcc cmake gnumake pkg-config jq and the .dev outputs of alsa-lib openssl libvpx dav1d pipewire fontconfig freetype libxkbcommon expat, with PKG_CONFIG_PATH
(.dev outputs), LD_LIBRARY_PATH (the .out, .lib and .dev outputs of
those: the test binary of voelin-ui needs libfontconfig.so.1),
LIBCLANG_PATH and BINDGEN_EXTRA_CLANG_ARGS set by hand. With that,
cargo check --workspace --all-targets --locked passes on 1.94 at the merge
and at the head, voelin-ui, voelin-ui-vm, voelinctl and voelin-android
included.
| Check | Result |
|---|---|
cargo fmt $(scripts/own-crates.sh) -- --check |
1.94: clean at the head and at every commit (the merge first differed by the order of one use in voelin-ui-vm, fixed in the merge commit). Nightly: five files, the baseline's six without voelin-ui/src/studio.rs, which main's split removed (voelin-core/src/history.rs, voelin-media/src/ffmpeg/encoder.rs, voelin-stream/src/discovery.rs, voelin-ui/src/chat.rs, tools/voelinctl/src/engine.rs); voelin-ui-vm is clean on both. |
cargo clippy $(scripts/own-crates.sh) --all-targets --no-deps --locked -- -D warnings |
1.94: clean at the merge (and -p voelin-ui alone) and at the head. Each of the five new commits was checked out detached in this worktree and passes fmt and clippy: the merge on all own crates and on -p voelin-ui alone, the four others on -p voelin-core -p voelin-store. Nightly, -p voelin-core --all-targets: the same five errors as in 17.5 (result_large_err of shutdown_connection in ts/voice.rs, four chunks_exact in audio.rs), none in new code. |
cargo test -p voelin-core --locked --no-fail-fast |
At the head, 1.94 and nightly: 246 lib tests pass (244 + the two of this round), 2 are ignored, 2 fail, the two of the baseline (discover::tests::without_records_the_gateway_itself_is_asked, web::tests::pictures_go_through_the_proxy_named_for_each_hop: localhost resolves to ::1 only here); the integration tests pass (session_fake 19 and 2 ignored, the others as in 17.5). At the merge, before the minors: 244, the same two, and the integration numbers of 17.5. cargo test -p voelin-ui -p voelin-ui-vm -p voelinctl: 35, 146 and 7 pass. voelin-store (a comment changed): 31 lib tests and 49 of its integration tests pass, but store::tests::a_blocked_checkpoint_waits_briefly_and_leaves_the_busy_timeout_as_it_was failed once, in a run under a load average of 8.5 from other jobs on this machine (it asserts that a checkpoint returned in under a second of wall clock); it passed in five isolated runs and three more runs of the crate; it was not chased (a crate this round left alone; the bound was replaced in phase4/keystore-task34 by a one-hour busy timeout and a 30 s hang detector). |
| The lib suite 10 times in a row (1.94) | cargo test -p voelin-core --lib: ten runs, each 246 passed, 2 failed, 2 ignored, the same two failing tests every time, the banner test passing every time. The same ten runs with those two tests skipped (--skip): exit 0 every time (246 passed, 2 ignored). session::banner_tests::a_failing_banner_is_logged_once_with_its_address (17.5 saw it fail once) did not fail in these 20 full runs, so the test is as it was: a fix would be a guess at a cause nobody has seen. |
RUSTDOCFLAGS='-D warnings' cargo doc --no-deps -p voelin-core |
passes, with and without --features media-desktop. |
| The acceptance of section 10 | The rg is empty from the repository root (--glob '!**/ts/**') and from crates/voelin-core/src (--glob '!ts/**'), with the four exceptions; session.rs names none of tsclientlib, tsproto, voelin_query, ts_bookkeeping; the grep of pub items outside ts/ is empty; the rustdoc JSON of voelin-core (nightly, --features media-desktop; every item of the crate, 5,292 of them, whose type references name tsclientlib, tsproto*, ts_bookkeeping, voelin_query or voelin_observer) has 11 items with such references, all in voelin_core::ts (to_blob, from_blob, export, write_export, improve_level, Found::identity, resolve, native_version, KnownVersion::to_version and the two setters), none elsewhere; voelin_core::stream keeps its re-exports; cargo tree -p voelin-core -e normal still lists tsclientlib and tsproto*. |
scripts/notices.sh --check (cargo-about 0.9.2, built under the scratch directory) |
up to date at the merge and at the head; Cargo.lock did not change after the merge. |
scripts/it-smoke.sh ts3 ts6 |
Before (6a08147, the head of slice 3) and after (f1df886): fresh compose stacks (down -v, up -d, project voelin-seam-merge, state directory under the scratch directory) and the same result: every per-server scenario passes, the TeamSpeak session module stage 12 passed and 2 ignored (16.34 s before, 16.39 s after), the engine stage 5 passed and 1 failed at live.rs:396 (ts6_banners, the baseline's failure, 17.5). The two outputs, 99 lines each (the compose lines left out), are equal line by line with digits, base64 runs and uuids masked, but for the random uid of the streamer in the stream-directory line and the name of the state directory in two paths. |
The live binaries by hand, serially, --features media-desktop, on the same servers |
Before and after alike: ts_session::live_tests --include-ignored 14 of 14 (46.42 s, 46.43 s), live 6 of 6 (73.40 s, 73.39 s), media_live 2, stream_live 3, voice_features 3, voelin-stream's live_ts6 1. |
The last bullet of 17.6 (documents that still name the old paths) is closed by
76a884a; the others stand.
17.8 The round after the gate (phase4/seam-followups)
The Opus gate of the merge (c60acf9) accepted it with one minor and notes for
H9. This round, on phase4/seam-followups from c60acf9, closes the minor,
writes the notes down (17.6) and deals with the five tests that failed on
their own on main. No history was rewritten. The mao-* agents were not
registered in the session, so a general-purpose agent played
mao-implementer, attempt 1.
| Commit | What |
|---|---|
a856f90 |
The gate's minor. ts::identity::from_json is the classification from_blob had (malformed, cut short, not an identity, unreadable, with line and column, never the value), taking the JSON text; from_blob and ts_session::inner_options both use it. inner_options had put the serde_json error into the text, and tsproto's key reader reports a key that does not import as invalid_value(Unexpected::Str(key), ..), so the key reached LinkEvent::Disconnected(Some(text)), Event::Error and the status line. A credential that is not UTF-8 is "it is not text". Four tests, each with a key that lost its last two characters and none holding 8 characters in a row of the key: identity::tests (which also asserts that the reader's own message does quote it), ts_session::tests (inner_options), link::tests (the Disconnected text through SessionLink and the real connector) and session_fake (ConnectVoice through the engine with Backends::default(): the Disconnected state, the Error event and every event after it). The three connector-side ones fail with the serde_json text put back. |
563482d |
VoiceOptions::nickname and server_password have their docs; Backends::set_account says that no connector reads ConnectParams.account yet and that H4 moves the myTeamSpeak proof to it. |
96ff0e0 |
The edge list of 17.6, and the H9 row of 11.2 pointing to it. |
9254e08 |
identity::tests::improve_level_keeps_the_key. |
0d67dd7 |
voice_features::contacts_are_kept_in_the_database. |
4be37e1 |
session::banner_tests::a_failing_banner_is_logged_once_with_its_address, through web::tests::info_lines. |
e614a1c |
discover::tests::without_records_the_gateway_itself_is_asked. |
a90bb70 |
web::tests::pictures_go_through_the_proxy_named_for_each_hop. |
c35bbb5 |
voelin-platform's proxy::the_portal_names_the_proxy. |
The five flakes: all fixed, none recorded as known. Two of the fixes are rewrites of a test helper and a test, not one-line edits.
improve_level_keeps_the_key: a freshIdentity::create()stops at the first counter of level 8 or more and about one in 32 has 13 already, whichimprove_levelreturns as it is. The test asks for three levels above what its identity has. 8 failures in 300 runs of the single test before, 0 in 300 after.contacts_are_kept_in_the_database: dropping anEnginedoes not close the history database. The engine task ends later, the history writer is joined there, and closing the connection checkpoints the write-ahead log under an exclusive lock with fsyncs; the secondHistory::openwaits for that lock for the 5 s busy timeout only and fails withDatabaseBusywhen a loaded disk makes the close slower. A connection was still open (the-walfile still there) in 23 of 24 instrumented runs, and 10 of those 24 (eight at a time on a loaded machine) failed. The test now waits for the-walfile to go (SQLite deletes it when the last connection closes) before it reopens. With every fsync of the test process delayed by 6 s (strace -f -e inject=fsync,fdatasync:delay_enter=6000000) the old test fails every time at the reopen, and the new one passes.a_failing_banner_is_logged_once_with_its_address(lines == []):web::tests::info_linesread the log withtracing::subscriber::with_default. While that scoped subscriber is the only one alive,tracing-coreregisters a callsite that another test's thread meets first against that thread's own default (none) and the callsite stays disabled for every thread (callsite::Dispatchers::rebuilder,has_just_one). Several tests ofbanner_testsreach the same callsite throughimage_finished. The helper now installs one recording subscriber as the global default the first time and records into a buffer per thread. A new test (info_lines_see_a_callsite_ another_thread_met_first) fails with the old helper (lines == [], the failure that was seen) and passes with the new one. The old helper failed 1 of 300 runs ofbanner_tests, the new one 0 of 600. The failure of the whole suite did not occur in the twenty full runs below, so the evidence for this fix is the mechanism, the new test and these rates.- The two
localhosttests fail wherelocalhostresolves to::1only (the servers of the tests listen on 127.0.0.1). The discovery test'sprobinghelper and the test SOCKS proxy diallocalhostat 127.0.0.1; what the tests check (the name the gateway is asked at, the name the proxy is given) is unchanged. the_portal_names_the_proxydid not needdbus-run-sessiononly: with a session bus, on the desktop's or on a private one made by plaindbus-run-session, it failed here three times out of three at "the portal leaves the bus", because the bus can start the realxdg-desktop-portalby name, which the first call after the stand-in has left does, and the real one answers instead of the "missing for a minute" the test expects. The test now runs itself again underdbus-run-sessionwith a bus configuration of its own, a session bus without service directories. Withoutdbus-run-session, or when the bus does not come up, it prints "skipped, nothing was checked" and the reason and passes. On the bus with the default services the same test still fails (checked by hand).
What ran. The environment of 17.7, taken again: nix shell of gcc cmake gnumake pkg-config jq and the .dev outputs of alsa-lib openssl libvpx dav1d pipewire fontconfig freetype libxkbcommon expat, with PKG_CONFIG_PATH (the
.dev outputs), LIBCLANG_PATH, BINDGEN_EXTRA_CLANG_ARGS (-isystem the
glibc.dev headers: libspa-sys fails without) and, to run the binaries it
builds, LD_LIBRARY_PATH (the .out outputs of those: libvpx.so.12) set by
hand, and the 1.94 and nightly toolchains from their store paths in front of
PATH. The dev rust-nightly shell does not build here (cargo-llvm-cov).
With that, cargo check --workspace --all-targets --locked passes on 1.94, the
voelin-ui, voelin-ui-vm, voelinctl, voelin-gateway and voelin-android
targets included.
| Check | Result |
|---|---|
cargo fmt $(scripts/own-crates.sh) --check |
1.94: clean at the head and at each of the nine commits, checked out detached one by one. cargo fmt --all --check as such is not clean at c60acf9 on any toolchain: it includes the vendored crates/proto, which formats with upstream's nightly configuration, and the nightly rustfmt also reformats own files that 1.94's leaves alone (the CI runs the form above). |
cargo clippy -p voelin-core -p voelin-platform --all-targets --locked --no-deps -- -D warnings |
1.94: clean at each of the nine commits, checked out detached one by one. |
cargo test -p voelin-core --locked --lib, ten times in a row, no exclusions |
Nightly: ten runs, each 252 passed, 2 ignored. 1.94: the same ten times. (The baseline of 17.5 and 17.7 had two failures in each run and needed --skip.) |
cargo test -p voelin-core --locked, once |
Both toolchains: green. Integration tests: gateway 9, live 6 and stream_live 3 (they skip without VOELIN_LIVE), session_backends 2, session_fake 20 passed and 2 ignored, settings 1, voice_features 3. |
cargo test -p voelin-platform --locked |
Both toolchains: 24 lib tests, crash 3, proxy 1 (on its own bus), x11 1 (skipped without a display), 2 doc tests. |
RUSTDOCFLAGS=-D warnings cargo doc --no-deps -p voelin-core --locked |
1.94 and nightly: clean. |
Cargo.lock, THIRD_PARTY_NOTICES.md |
Unchanged: git diff c60acf9 -- Cargo.lock Cargo.toml is empty, so there was nothing to regenerate. |
scripts/it-smoke.sh ts3 ts6, on c60acf9 (before) and at the head (after) |
The stack of VoelinGateWay/dev/docker-compose.yml as a compose project of its own (voelin-seam-followups), the state directory under the scratch directory. On a fresh stack each (down -v, up -d before each): both pass every per-server scenario of ts3 and ts6 (connect and tree, server and channel chat, voice tone, invisible presence, relay, gateway, history, pins and reactions, the engine's voice features, the TeamSpeak 6 streams), the TeamSpeak session module stage (12 passed, 2 ignored; 16.38 s before, 16.73 s after) and fail in the same place, the engine stage at ts6_banners (live.rs:396, 5 passed, 1 failed), the failure 17.5 and 17.7 record. Two more runs on the first stack, which was no longer fresh (before, then after), gave the same: the outputs have 100 lines each and differ only in ids, counters, tone ratios and the number of tests filtered out of the module stage (236 before, 240 after: this round's four unit tests). The very first run, on c60acf9 on the first stack, stopped earlier, at the first gateway request of the admin identity of ts3 (config_set not answered, observe stayed Connecting); it did not repeat on the fresh stack at c60acf9, nor in any later run, and was not chased. |