quantframe: 1.5.9 -> 1.6.12 (#484972)

This commit is contained in:
Gergő Gutyina
2026-02-26 22:06:57 +00:00
committed by GitHub
3 changed files with 225 additions and 133 deletions
@@ -1,164 +1,95 @@
diff --git a/src-tauri/src/qf_client/modules/analytics.rs b/src-tauri/src/qf_client/modules/analytics.rs
index f68e185..355723e 100644
--- a/src-tauri/src/qf_client/modules/analytics.rs
+++ b/src-tauri/src/qf_client/modules/analytics.rs
@@ -37,7 +37,7 @@ impl AnalyticsModule {
current_page: "home".to_string(),
component: "Analytics".to_string(),
is_init: false,
- send_metrics: true,
+ send_metrics: false,
last_user_activity: Arc::new(Mutex::new(Instant::now())),
metricAndLabelPairsScheduledToSend: vec![],
}
@@ -77,90 +77,7 @@ impl AnalyticsModule {
}
pub fn init(&mut self) -> Result<(), AppError> {
let app = states::app_state()?;
- if self.is_init {
- return Ok(());
- }
- self.is_init = true;
- self.update_state();
-
- let is_first_install = app.is_first_install.clone();
- tauri::async_runtime::spawn({
diff --git a/src-tauri/qf_api/src/endpoints/analytics.rs b/src-tauri/qf_api/src/endpoints/analytics.rs
index b7ea6076..1476cfc1 100644
--- a/src-tauri/qf_api/src/endpoints/analytics.rs
+++ b/src-tauri/qf_api/src/endpoints/analytics.rs
@@ -52,35 +52,7 @@ impl AnalyticsRoute {
pub fn start(self: Arc<Self>) -> Result<(), ApiError> {
let mut stop = self._stop.lock().unwrap();
- *stop = false;
- tokio::spawn({
- let this = Arc::clone(&self);
- async move {
- // Create a new instance of the QFClient and store it in the app state
- let qf = states::qf_client().expect("Failed to get qf client");
-
- // Create Timer for sending metrics
- let mut last_metric_time = Instant::now();
-
- if is_first_install {
- qf.analytics()
- .metricAndLabelPairsScheduledToSend
- .push(HashMap::from([(
- "First_Install".to_string(),
- "true".to_string(),
- )]));
- }
- loop {
- let send_metrics = qf.analytics().send_metrics;
- if !send_metrics {
- tokio::time::sleep(std::time::Duration::from_secs(60)).await;
- if *this._stop.lock().unwrap() {
- break;
- }
- if last_metric_time.elapsed() < Duration::from_secs(30) || !this.is_active() {
- tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
- continue;
- }
-
- if last_metric_time.elapsed() < Duration::from_secs(15)
- || !qf.analytics().is_user_active()
- {
- tokio::time::sleep(std::time::Duration::from_secs(5)).await;
- continue;
- }
-
- if last_metric_time.elapsed() < Duration::from_secs(60)
- && !qf.analytics().is_user_active()
- {
- tokio::time::sleep(std::time::Duration::from_secs(5)).await;
- continue;
- }
-
- last_metric_time = Instant::now();
- // logger::info_con(
- // &qf.analytics().get_component("TrySendAnalytics"),
- // "Sending user activity",
- // );
- match qf
- .analytics()
- .try_send_analytics(
- "users/metrics/periodic",
- 3,
- json!(qf.analytics().metricAndLabelPairsScheduledToSend),
- )
- .await
- {
-
- match this.send_current_metrics().await {
- Ok(_) => {
- qf.analytics().clear_metrics();
- this._metrics.lock().unwrap().clear();
- }
- Err(e) => {
- if e.cause().contains("Unauthorized")
- || e.cause().contains("Banned")
- || e.cause().contains("WFMBanned")
- {
- error::create_log_file("analytics.log", &e);
- break;
- } else if e.cause().contains("429") {
- logger::info(
- &qf.analytics().get_component("TrySendAnalytics"),
- "Rate limit reached, waiting for 60 seconds",
- LoggerOptions::default(),
- );
- tokio::time::sleep(std::time::Duration::from_secs(60)).await;
- continue;
- }
- error::create_log_file("analytics.log", &e);
- eprintln!("Failed to send metrics: {}", e);
- }
- };
- // Sleep for a while before checking again
- tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
- }
- qf.analytics().is_init = false;
- }
- });
+ self.is_init = false;
+ *stop = true;
Ok(())
}
pub fn set_send_metrics(&mut self, send_metrics: bool) {
@@ -173,45 +90,6 @@ impl AnalyticsModule {
@@ -100,40 +72,6 @@ impl AnalyticsRoute {
mut retry_count: i64,
data: Value,
) -> Result<(), AppError> {
- let mut parameters: Vec<String> = vec![];
- if self.is_user_active() {
- parameters.push(format!("Active_Page={}", self.current_page));
- }
) -> Result<(), ApiError> {
- let client = self.client.upgrade().expect("Client should not be dropped");
-
- while retry_count >= 0 {
- let err = match self
- .client
- .post::<Value>(
- format!("{}?{}", url, parameters.join("&")).as_str(),
- data.clone(),
- let err = match client
- .call_api::<Value>(
- Method::POST,
- format!("{}", url).as_str(),
- Some(data.clone()),
- None,
- ResponseFormat::Json,
- )
- .await
- {
- Ok(ApiResult::Success(_, _)) => {
- Ok(_) => {
- return Ok(());
- }
- Ok(ApiResult::Error(e, _headers)) => AppError::new_api(
- &self.get_component("TrySendAnalytics"),
- e,
- eyre!("Failed to send analytics"),
- LogLevel::Error,
- ),
- Err(e) => e,
- };
- if let ApiError::UserBanned(_) = &err {
- let mut stop = self._stop.lock().unwrap();
- *stop = true;
- return Err(err);
- }
-
- if retry_count == 0 {
- return Err(err);
- }
- retry_count -= 1;
- logger::warning(
- &self.get_component("TrySendAnalytics"),
- &format!(
- "Failed to send analytics, retrying in 5 seconds, retries left: {}",
- retry_count
- ),
- LoggerOptions::default(),
- println!(
- "Retrying to send analytics data, attempts left: {}",
- retry_count
- );
- tokio::time::sleep(std::time::Duration::from_secs(5)).await;
- }
Ok(())
}
}
diff --git a/src/contexts/app.context.tsx b/src/contexts/app.context.tsx
index 7897db9..1945ab9 100644
index 673440d9..26d09d0b 100644
--- a/src/contexts/app.context.tsx
+++ b/src/contexts/app.context.tsx
@@ -160,7 +160,7 @@ export function AppContextProvider({ children }: AppContextProviderProps) {
const id = context.substring(start, end);
@@ -124,7 +124,7 @@ export function AppContextProvider({ children }: AppContextProviderProps) {
const end = context.indexOf("</ID>");
const id = context.substring(start, end);
console.log("OpenTos", settings?.tos_uuid, id);
- if (id == settings?.tos_uuid) return;
+ if (true) return;
modals.open({
title: useTranslateModals("tos.title"),
size: "100%",
- if (id == info?.tos_uuid) return;
+ if (info || true) return;
const modalId = modals.open({
title: useTranslateComponent("modals.tos.title", { version: id }),
withCloseButton: false,
@@ -0,0 +1,149 @@
diff --git a/package.json b/package.json
index d2ca05f1..37693a7b 100644
--- a/package.json
+++ b/package.json
@@ -25,11 +25,11 @@
"@mantine/notifications": "8.3.8",
"@mantine/tiptap": "8.3.8",
"@tanstack/react-query": "^5.64.1",
- "@tauri-apps/api": "^2.0.0",
+ "@tauri-apps/api": "2.6.0",
"@tauri-apps/plugin-clipboard-manager": "^2.3.0",
"@tauri-apps/plugin-dialog": "~2",
- "@tauri-apps/plugin-fs": "~2",
- "@tauri-apps/plugin-http": "~2",
+ "@tauri-apps/plugin-fs": "2.3.0",
+ "@tauri-apps/plugin-http": "2.4.4",
"@tauri-apps/plugin-notification": "~2",
"@tauri-apps/plugin-os": "~2",
"@tauri-apps/plugin-process": "~2",
@@ -66,4 +66,4 @@
"vite": "^4.5.0",
"vite-plugin-svgr": "^2.4.0"
}
-}
\ No newline at end of file
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 531c77f5..dc542aca 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -48,8 +48,8 @@ importers:
specifier: ^5.64.1
version: 5.64.1(react@18.3.1)
'@tauri-apps/api':
- specifier: ^2.0.0
- version: 2.0.0
+ specifier: 2.6.0
+ version: 2.6.0
'@tauri-apps/plugin-clipboard-manager':
specifier: ^2.3.0
version: 2.3.0
@@ -57,11 +57,11 @@ importers:
specifier: ~2
version: 2.2.0
'@tauri-apps/plugin-fs':
- specifier: ~2
- version: 2.2.0
+ specifier: 2.3.0
+ version: 2.3.0
'@tauri-apps/plugin-http':
- specifier: ~2
- version: 2.2.0
+ specifier: 2.4.4
+ version: 2.4.4
'@tauri-apps/plugin-notification':
specifier: ~2
version: 2.2.1
@@ -767,11 +767,8 @@ packages:
peerDependencies:
react: ^18 || ^19
- '@tauri-apps/api@2.0.0':
- resolution: {integrity: sha512-moKgCp2EX7X5GiOx/G/bmoEpkFQVVmyS98UaJU4xUVzan+E1BdwlAKcbip+cGldshYOqL4JSwAEN1OkRXeug0Q==}
-
- '@tauri-apps/api@2.7.0':
- resolution: {integrity: sha512-v7fVE8jqBl8xJFOcBafDzXFc8FnicoH3j8o8DNNs0tHuEBmXUDqrCOAzMRX0UkfpwqZLqvrvK0GNQ45DfnoVDg==}
+ '@tauri-apps/api@2.6.0':
+ resolution: {integrity: sha512-hRNcdercfgpzgFrMXWwNDBN0B7vNzOzRepy6ZAmhxi5mDLVPNrTpo9MGg2tN/F7JRugj4d2aF7E1rtPXAHaetg==}
'@tauri-apps/cli-darwin-arm64@2.2.5':
resolution: {integrity: sha512-qdPmypQE7qj62UJy3Wl/ccCJZwsv5gyBByOrAaG7u5c/PB3QSxhNPegice2k4EHeIuApaVJOoe/CEYVgm/og2Q==}
@@ -844,11 +841,11 @@ packages:
'@tauri-apps/plugin-dialog@2.2.0':
resolution: {integrity: sha512-6bLkYK68zyK31418AK5fNccCdVuRnNpbxquCl8IqgFByOgWFivbiIlvb79wpSXi0O+8k8RCSsIpOquebusRVSg==}
- '@tauri-apps/plugin-fs@2.2.0':
- resolution: {integrity: sha512-+08mApuONKI8/sCNEZ6AR8vf5vI9DXD4YfrQ9NQmhRxYKMLVhRW164vdW5BSLmMpuevftpQ2FVoL9EFkfG9Z+g==}
+ '@tauri-apps/plugin-fs@2.3.0':
+ resolution: {integrity: sha512-G9gEyYVUaaxhdRJBgQTTLmzAe0vtHYxYyN1oTQzU3zwvb8T+tVLcAqCdFMWHq0qGeGbmynI5whvYpcXo5LvZ1w==}
- '@tauri-apps/plugin-http@2.2.0':
- resolution: {integrity: sha512-ZY6sIHhgu8hcu6BkkegoiOEbvOsQFSVcK8J7l+g9RNHrkhl5uzpNIytR4R/H50fj7gyG80DJvrXDx/LBo7Easw==}
+ '@tauri-apps/plugin-http@2.4.4':
+ resolution: {integrity: sha512-IjlaaS4z8ybB10qnh6djZ2FIaHdWVs/U1D1C56udKcjX1f+jAmR8/s7qBV5cv/OmcGkOIzet3LWuH70LKf4J2A==}
'@tauri-apps/plugin-notification@2.2.1':
resolution: {integrity: sha512-QF8Zod6XDhxD6xkD5nU/BjbOpJ6+3gxGCrVULOdLpvMuMSN2Z2IdObV/qgnrEJk1UamUCF1ClQUqNCbk4zTJNQ==}
@@ -2835,9 +2832,7 @@ snapshots:
'@tanstack/query-core': 5.64.1
react: 18.3.1
- '@tauri-apps/api@2.0.0': {}
-
- '@tauri-apps/api@2.7.0': {}
+ '@tauri-apps/api@2.6.0': {}
'@tauri-apps/cli-darwin-arm64@2.2.5':
optional: true
@@ -2884,39 +2879,39 @@ snapshots:
'@tauri-apps/plugin-clipboard-manager@2.3.0':
dependencies:
- '@tauri-apps/api': 2.7.0
+ '@tauri-apps/api': 2.6.0
'@tauri-apps/plugin-dialog@2.2.0':
dependencies:
- '@tauri-apps/api': 2.0.0
+ '@tauri-apps/api': 2.6.0
- '@tauri-apps/plugin-fs@2.2.0':
+ '@tauri-apps/plugin-fs@2.3.0':
dependencies:
- '@tauri-apps/api': 2.0.0
+ '@tauri-apps/api': 2.6.0
- '@tauri-apps/plugin-http@2.2.0':
+ '@tauri-apps/plugin-http@2.4.4':
dependencies:
- '@tauri-apps/api': 2.0.0
+ '@tauri-apps/api': 2.6.0
'@tauri-apps/plugin-notification@2.2.1':
dependencies:
- '@tauri-apps/api': 2.0.0
+ '@tauri-apps/api': 2.6.0
'@tauri-apps/plugin-os@2.2.1':
dependencies:
- '@tauri-apps/api': 2.0.0
+ '@tauri-apps/api': 2.6.0
'@tauri-apps/plugin-process@2.2.0':
dependencies:
- '@tauri-apps/api': 2.0.0
+ '@tauri-apps/api': 2.6.0
'@tauri-apps/plugin-shell@2.2.0':
dependencies:
- '@tauri-apps/api': 2.0.0
+ '@tauri-apps/api': 2.6.0
'@tauri-apps/plugin-updater@2.9.0':
dependencies:
- '@tauri-apps/api': 2.7.0
+ '@tauri-apps/api': 2.6.0
'@tiptap/core@3.6.2(@tiptap/pm@3.6.2)':
dependencies:
+22 -10
View File
@@ -4,7 +4,7 @@
fetchFromGitHub,
cargo-tauri,
nodejs,
pnpm_9,
pnpm_10,
fetchPnpmDeps,
pnpmConfigHook,
pkg-config,
@@ -15,17 +15,18 @@
libsoup_3,
libayatana-appindicator,
gtk3,
gst_all_1,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "quantframe";
version = "1.5.9";
version = "1.6.12";
src = fetchFromGitHub {
owner = "Kenya-DK";
repo = "quantframe-react";
tag = "v${finalAttrs.version}";
hash = "sha256-jrGDgK/Z9oLSvtFfC+uIs0vj4Nku4Sp/bdR1MX/SK2E=";
hash = "sha256-IF+8filOXG+4nWpivyYknkT+hAg8nhG10Hfm79/m3Uc=";
};
postPatch = ''
@@ -36,16 +37,24 @@ rustPlatform.buildRustPackage (finalAttrs: {
--replace-fail '"createUpdaterArtifacts": "v1Compatible"' '"createUpdaterArtifacts": false'
'';
patches = [ ./0001-disable-telemetry.patch ];
patches = [
./0001-disable-telemetry.patch
./0002-sync-node-packages.patch
];
pnpmDeps = fetchPnpmDeps {
inherit (finalAttrs) pname version src;
pnpm = pnpm_9;
fetcherVersion = 1;
hash = "sha256-ncoxliXnLxWEXL1Z7ixOULI/uYkxmfLiDWu1tDSRsrM=";
inherit (finalAttrs)
pname
version
src
patches
;
pnpm = pnpm_10;
fetcherVersion = 3;
hash = "sha256-omomvnHUiEfGVJn6LApWOnRwSVO8kpMLN3Jz0MhwPpQ=";
};
cargoHash = "sha256-0IgQK0jMVN6u5i4lBKK8njbMyRQCLguTdDcSBnFnyso=";
cargoHash = "sha256-Ffy7dutFVQNZUFm9/iW0qPqUJ9bbRW6PeuC3eNNqfk8=";
nativeBuildInputs = [
cargo-tauri.hook
@@ -53,7 +62,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
wrapGAppsHook3
nodejs
pnpmConfigHook
pnpm_9
pnpm_10
];
buildInputs = [
@@ -63,6 +72,9 @@ rustPlatform.buildRustPackage (finalAttrs: {
gtk3
libayatana-appindicator
webkitgtk_4_1
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
];
cargoRoot = "src-tauri";