push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,164 @@
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({
- 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;
- 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
- {
- Ok(_) => {
- qf.analytics().clear_metrics();
- }
- 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);
- }
- };
- }
- qf.analytics().is_init = false;
- }
- });
+ self.is_init = false;
Ok(())
}
pub fn set_send_metrics(&mut self, send_metrics: bool) {
@@ -173,45 +90,6 @@ impl AnalyticsModule {
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));
- }
-
- while retry_count >= 0 {
- let err = match self
- .client
- .post::<Value>(
- format!("{}?{}", url, parameters.join("&")).as_str(),
- data.clone(),
- )
- .await
- {
- Ok(ApiResult::Success(_, _)) => {
- 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 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(),
- );
- 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
--- 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);
console.log("OpenTos", settings?.tos_uuid, id);
- if (id == settings?.tos_uuid) return;
+ if (true) return;
modals.open({
title: useTranslateModals("tos.title"),
size: "100%",

View File

@@ -0,0 +1,80 @@
{
lib,
rustPlatform,
fetchFromGitHub,
cargo-tauri,
nodejs,
pnpm_9,
pkg-config,
glib-networking,
openssl,
webkitgtk_4_1,
wrapGAppsHook3,
libsoup_3,
libayatana-appindicator,
gtk3,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "quantframe";
version = "1.5.3";
src = fetchFromGitHub {
owner = "Kenya-DK";
repo = "quantframe-react";
tag = "v${finalAttrs.version}";
hash = "sha256-afTiQzHat6k+BF8EhYhd0o0FzYjq7GpnOnjRhjXASG8=";
};
postPatch = ''
substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \
--replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
substituteInPlace src-tauri/tauri.conf.json \
--replace-fail '"createUpdaterArtifacts": "v1Compatible"' '"createUpdaterArtifacts": false'
'';
patches = [ ./0001-disable-telemetry.patch ];
pnpmDeps = pnpm_9.fetchDeps {
inherit (finalAttrs) pname version src;
fetcherVersion = 1;
hash = "sha256-ncoxliXnLxWEXL1Z7ixOULI/uYkxmfLiDWu1tDSRsrM=";
};
cargoHash = "sha256-0IgQK0jMVN6u5i4lBKK8njbMyRQCLguTdDcSBnFnyso=";
nativeBuildInputs = [
cargo-tauri.hook
pkg-config
wrapGAppsHook3
nodejs
pnpm_9.configHook
];
buildInputs = [
openssl
libsoup_3
glib-networking
gtk3
libayatana-appindicator
webkitgtk_4_1
];
cargoRoot = "src-tauri";
buildAndTestSubdir = finalAttrs.cargoRoot;
passthru.updateScript = nix-update-script { };
meta = {
description = "Warframe Market listings and transactions manager";
mainProgram = "quantframe";
homepage = "https://quantframe.app/";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [
nyukuru
enkarterisi
];
};
})