feat: release GP Connect 3.3.0 with Native Shell support

This commit is contained in:
Kevin Yue committed 2026-11-05 23:05:14 +08:00
1 parent d12d677208
commit fd08cdbe66
226 files changed
+7700 -5225

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
//! Desktop portal discovery: protocol retrieval followed by native location detection.
use super::{PortalConfig, retrieve_config};
use crate::{credential::Credential, gp_params::GpParams};
use tokio_util::sync::CancellationToken;
/// Do not drop this future on disconnect: native detection must cancel and join.
pub async fn discover(
portal: &str,
credential: &Credential,
params: &GpParams,
cancellation: &CancellationToken,
) -> anyhow::Result<PortalConfig> {
let policy = retrieve_config(portal, credential, params, cancellation).await?;
let detected = match policy.detection() {
Some(detection) => Some(
crate::session::desktop::network::detect(detection, cancellation)
.await
.unwrap_or_else(|error| {
log::warn!("Internal host detection failed: {error}");
false
}),
),
None => None,
};
if cancellation.is_cancelled() {
anyhow::bail!("Portal configuration cancelled");
}
Ok(policy.select_gateways(detected.unwrap_or(false), detected))
}