Skip to content

Conversation

@matous-volf
Copy link
Contributor

Similarly to #4916, closes #5247.

@matous-volf matous-volf requested a review from a team as a code owner January 21, 2026 18:06
Comment on lines 846 to 853

/// Error during serialization/deserialization.
#[error("serde_json error")]
Json(#[from] serde_json::Error),

/// Error during serialization/deserialization.
#[error("ciborium error")]
Cbor(#[from] ciborium::de::Error<std::io::Error>),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are used nowhere.

.status()
.as_ref()
.map(StatusCode::as_u16)
.unwrap_or(DEFAULT_STATUS_CODE),
Copy link
Contributor Author

@matous-volf matous-volf Jan 21, 2026

Choose a reason for hiding this comment

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

I am not sure how you guys handle these kinds of cases. This code returns a zero status code, which is not very valid (even the StatusCode type accepts only NonZeroU16).

I guess after checking that value.is_status() (which this code does), we could just do something like .expect("status code not present when is_status is true"), but that could theoretically panic, which is exactly what this PR is trying to avoid.

Comment on lines -622 to +626
let response = native::send_request(request, &self.protocols)
.await
.unwrap();
let response = native::send_request(request, &self.protocols).await?;

let (inner, protocol) = response
.into_stream_and_protocol(self.protocols, None)
.await
.unwrap();
.await?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the whole point of this PR. Everything else are required error type conversions.

@jkelleyrtp
Copy link
Member

jkelleyrtp commented Jan 21, 2026

I would prefer we not pull in large deps in the fullstack-core crate. Can we just place the conversions inline in the higher level crates?

Placing them too low bloats the compile graph and slows down our compile times.

@matous-volf
Copy link
Contributor Author

Sure, is it okay like this?

@jkelleyrtp jkelleyrtp merged commit 7a7f5fb into DioxusLabs:main Jan 23, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panics on network errors due to .unwrap() calls in dioxus-fullstack WebSockets

2 participants