Triage and fix myriad TLS problems #45

Merged
puregarlic merged 6 commits from issue/42 into main 2026-02-26 21:54:09 -08:00
Owner

The Tauri client application couldn't connect to TLS-secured endpoints because the tonic crate needed TLS features. Adding these features conflicted with an outstanding (previously untested) issue with the server, since livekit_api and tonic requested different conflicting features from rustls. This resulted in undefined behavior; since the two applications are significantly different, this PR separates the two into their own Cargo workspaces, so that they no longer share a lockfile.

tracing_forest was also replaced on the client side in the process of debugging this issue. tracing_forest buffers events for logging until their parent span is closed; this means that events in permanent tasks are only logged once the application is exited. It has been replaced with tracing_tree, its precursor, which logs events as they are raised, regardless of their parent span status.

Closes #42
Closes #46

The Tauri client application couldn't connect to TLS-secured endpoints because the `tonic` crate needed TLS features. Adding these features conflicted with an outstanding (previously untested) issue with the server, since `livekit_api` and `tonic` requested different conflicting features from `rustls`. This resulted in undefined behavior; since the two applications are significantly different, this PR separates the two into their own Cargo workspaces, so that they no longer share a lockfile. `tracing_forest` was also replaced on the client side in the process of debugging this issue. `tracing_forest` buffers events for logging until their parent span is closed; this means that events in permanent tasks are only logged once the application is exited. It has been replaced with `tracing_tree`, its precursor, which logs events as they are raised, regardless of their parent span status. Closes #42 Closes #46
The output of forest is nice, but it buffers events to print until the
span has ended. This means that events for tasks like config watchers
will _never_ get logged to console, or at least until the application is
closed.

There are also some new logpoints, and a formatter for errored gRPC ops.
puregarlic changed title from Triage and fix myriad TLS problems to WIP: Triage and fix myriad TLS problems 2026-02-25 16:41:44 -08:00
Author
Owner

Alright... It's working in debug now, but broken in release. I'll probably need to solve #44 to get at the reasons why, as there's no logs available for me to look at currently.

Alright... It's working in `debug` now, but broken in `release`. I'll probably need to solve #44 to get at the reasons why, as there's no logs available for me to look at currently.
block in the application setup to instantiate the client, instead of
delegating the task to the `handle_config_changes` process. This resolves
an issue where non-TLS connections work in the `release` build, but TLS
connections fail.
puregarlic changed title from WIP: Triage and fix myriad TLS problems to Triage and fix myriad TLS problems 2026-02-25 23:34:27 -08:00
puregarlic changed title from Triage and fix myriad TLS problems to WIP: Triage and fix myriad TLS problems 2026-02-26 10:24:08 -08:00
Author
Owner

Handling #46 with this work as well. I'm stripping out the ConfigManager and the reactive logic to remove the source of these race condition bugs.

Handling #46 with this work as well. I'm stripping out the ConfigManager and the reactive logic to remove the source of these race condition bugs.
Resolves the race condition leading to #46
puregarlic changed title from WIP: Triage and fix myriad TLS problems to Triage and fix myriad TLS problems 2026-02-26 16:10:06 -08:00
seb approved these changes 2026-02-26 21:37:59 -08:00
@ -231,0 +107,4 @@
.await
{
Ok(num) => {
if num == 0 {
Collaborator

the value for the match arm can be anything, including a literal

so you can sometimes do:

Ok(0) => {
    warn!(channel_id, "attempted to join nonexistent channel");
    return Err(Status::not_found("channel does not exist"));
}
Ok(_) => {}

or

Ok(num) if num == 0 => {
    warn!(channel_id, "attempted to join nonexistent channel");
    return Err(Status::not_found("channel does not exist"));
}
Ok(_) => {}

instead of executing an inner if

the value for the match arm can be anything, including a literal so you can sometimes do: ``` Ok(0) => { warn!(channel_id, "attempted to join nonexistent channel"); return Err(Status::not_found("channel does not exist")); } Ok(_) => {} ``` or ``` Ok(num) if num == 0 => { warn!(channel_id, "attempted to join nonexistent channel"); return Err(Status::not_found("channel does not exist")); } Ok(_) => {} ``` instead of executing an inner if
@ -231,0 +228,4 @@
))
.await
.map_err(|err| {
match format_cause_chain(&err) {
Collaborator
.map_err(|err| {
    format_cause_chain(&err)
        .map(|cause| error!(cause, "failed to query room participants: {err}"))
        .unwrap_or_else(|| error!("failed to query room participants: {err}"));
    Status::internal("failed to retrieve channels")
})?;

this one is really iffy imo but here

``` .map_err(|err| { format_cause_chain(&err) .map(|cause| error!(cause, "failed to query room participants: {err}")) .unwrap_or_else(|| error!("failed to query room participants: {err}")); Status::internal("failed to retrieve channels") })?; ``` this one is really iffy imo but here
Sign in to join this conversation.
No description provided.