From 9e213968f5003e909f5190a15d3629cbfc5c2577 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Tue, 15 Sep 2026 17:33:21 +0200 Subject: [PATCH] =?UTF-8?q?Cl=C3=A9=20d'API=20rendue=20au=20client=20recon?= =?UTF-8?q?struit=20au=20d=C3=A9marrage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit La clé est persistée en base locale, mais le client était reconstruit sans elle : tous les appels suivants partaient anonymes, à commencer par celui qui rapporte la configuration à afficher. Co-Authored-By: Claude Opus 5 (1M context) --- lib/main.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 83bf43f..c52b13e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -35,7 +35,11 @@ void main() async { if(localContext != null && localContext.host != null) { print("we've got an local db !"); print(localContext); - localContext.clientAPI = new Client(localContext.host!); // retrieve instanceId from local DB + // La clé est persistée en base locale (`TabletAppContext.toMap`) : l'oublier ici + // reconstruisait un client anonyme au démarrage, et tous les appels suivants — + // à commencer par `deviceGetDetail` juste en dessous, qui donne la configuration + // à afficher — partaient sans identité. + localContext.clientAPI = new Client(localContext.host!, apiKey: localContext.apiKey); isConfig = localContext.configuration != null; print(localContext); print("localContext.deviceId");