From baad7c48bcfcc0582ab66eb93b33377aa8b53215 Mon Sep 17 00:00:00 2001 From: NicolasCantu Date: Wed, 22 Oct 2025 16:59:26 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20Am=C3=A9lioration=20de=20la=20synchronis?= =?UTF-8?q?ation=20pour=20quorum=3D1=20et=20ajout=20favicon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Synchronisation forcée du processus pour quorum=1 test - Mise à jour device plus fréquente dans les premières tentatives - Tentative de synchronisation SDK au 3ème essai - Ajout favicon.svg avec icône de bouclier - Ajout des liens favicon dans index.html - Meilleure gestion des processus de pairing avec quorum=1 --- index.html | 3 ++- public/favicon.svg | 27 +++++++++++++++++++++++++++ src/services/service.ts | 27 +++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 public/favicon.svg diff --git a/index.html b/index.html index f7f60fb..f6390ad 100755 --- a/index.html +++ b/index.html @@ -7,7 +7,8 @@ - + + 4NK Application diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..25ee7ff --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/services/service.ts b/src/services/service.ts index d16b7ab..2e116e8 100755 --- a/src/services/service.ts +++ b/src/services/service.ts @@ -907,6 +907,22 @@ export default class Services { } } + // For quorum=1, try to force process synchronization + if (i === 2) { + try { + console.log(`🔄 Forcing process synchronization for quorum=1 test...`); + // Force the SDK to recognize this as a pairing process + const process = await this.getProcess(processId); + if (process) { + console.log(`🔄 Process found, attempting to sync with SDK...`); + // Try to trigger SDK synchronization + await this.sdkClient.get_pairing_process_id(); + } + } catch (e) { + console.log(`⚠️ Process synchronization attempt failed: ${(e as Error).message}`); + } + } + // Check if the process exists in our processes list try { const process = await this.getProcess(processId); @@ -940,6 +956,17 @@ export default class Services { return; } + // For quorum=1 test, if we have a process but no commitment yet, + // try to force synchronization by calling updateDevice more frequently + if (i < 5) { + try { + await this.updateDevice(); + console.log(`🔄 Forced device update on attempt ${i + 1}`); + } catch (e) { + console.log(`⚠️ Forced device update failed: ${(e as Error).message}`); + } + } + console.log(`⏳ Still waiting for SDK synchronization... (${i + 1}/${maxRetries})`); // Only try updateDevice every 5 attempts to avoid spam