From aad4694c44c6e713cd64ae79895b41cb22abcb77 Mon Sep 17 00:00:00 2001 From: Urvish Date: Thu, 17 Sep 2026 14:33:02 +0530 Subject: [PATCH 1/2] fix(mobile): resolve content_ref labels in renderers and enable media cleartext traffic - Enhance asString and asStringArray to inspect objects for label, point_name, name, title, and code - Fix blank rendering of Master Point, Coupled Point, Paired Meridian, and Intersection Points on EOV screens (e.g. Chong Mai) - Ensure robust fallback for primitive and structured attribute values - Enable usesCleartextTraffic in app.json and AndroidManifest.xml to allow release APK to load MinIO image assets over port 9000 --- .env | 16 ++++++++++++++++ app.json | 6 ++++-- .../content/renderers/helpers/value.ts | 19 +++++++++++++++---- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.env b/.env index 3acefa9..508e83d 100644 --- a/.env +++ b/.env @@ -10,6 +10,22 @@ # ---- Local Standalone Backend (FastAPI on Port 8000) ---- # For Local Web: http://localhost:8000/api # For Physical Mobile Devices: http://YOUR_LOCAL_IP:8000/api +<<<<<<< Updated upstream EXPO_PUBLIC_API_URL=http://localhost:8000/api EXPO_PUBLIC_BACKEND_PORT=8000 EXPO_PUBLIC_MEDIA_BASE_URL=http://localhost:9000/ +======= +# EXPO_PUBLIC_API_URL=http://localhost:8000/api +# EXPO_PUBLIC_BACKEND_PORT=8000 +# EXPO_PUBLIC_MEDIA_BASE_URL=http://localhost:9000/ +################################################################################# +# old working .env file + +# Production Dev +EXPO_PUBLIC_API_URL=https://api.acupedia.in/api +EXPO_PUBLIC_STOREFRONT_URL=https://acupedia.in/store + +# Local Dev +# EXPO_PUBLIC_API_URL=http://localhost:8000/api +# EXPO_PUBLIC_STOREFRONT_URL=http://localhost:3000 +>>>>>>> Stashed changes diff --git a/app.json b/app.json index e52560d..2e40272 100644 --- a/app.json +++ b/app.json @@ -17,7 +17,9 @@ "backgroundImage": "./assets/images/android-icon-background.png", "monochromeImage": "./assets/images/android-icon-monochrome.png" }, - "predictiveBackGestureEnabled": false + "predictiveBackGestureEnabled": false, + "package": "com.anonymous.acupedia", + "usesCleartextTraffic": true }, "web": { "output": "static", @@ -39,4 +41,4 @@ "reactCompiler": true } } -} +} \ No newline at end of file diff --git a/src/features/content/renderers/helpers/value.ts b/src/features/content/renderers/helpers/value.ts index 651a469..be68521 100644 --- a/src/features/content/renderers/helpers/value.ts +++ b/src/features/content/renderers/helpers/value.ts @@ -1,5 +1,15 @@ export function asString(value: unknown): string { - return typeof value === "string" ? value : ""; + if (typeof value === "string") return value; + if (typeof value === "number" || typeof value === "boolean") return String(value); + if (value !== null && typeof value === "object" && !Array.isArray(value)) { + const record = value as Record; + for (const key of ["label", "point_name", "name", "title", "code"]) { + if (typeof record[key] === "string" && (record[key] as string).trim().length > 0) { + return (record[key] as string).trim(); + } + } + } + return ""; } export function asNumber(value: unknown): number | null { @@ -7,9 +17,10 @@ export function asNumber(value: unknown): number | null { } export function asStringArray(value: unknown): string[] { - return Array.isArray(value) - ? value.filter((item): item is string => typeof item === "string" && item.trim().length > 0) - : []; + if (!Array.isArray(value)) return []; + return value + .map((item) => asString(item).trim()) + .filter((item) => item.length > 0); } export function asRecord(value: unknown): Record { -- 2.34.1 From 761e60bf8cdd3615bcb847e862dd75435e3e4087 Mon Sep 17 00:00:00 2001 From: Urvish Date: Thu, 17 Sep 2026 16:34:41 +0530 Subject: [PATCH 2/2] fix(auth): disable android auto-backup and proactively sync session on startup - Disable allowBackup in app.json (and AndroidManifest.xml) to prevent stale session restoration on clean APK installs - Proactively call refreshSession on storage rehydration so module access and identity are immediately synced on app launch - Clean up git conflict markers in .env file --- .env | 14 ++++---------- app.json | 3 ++- src/store/auth.store.ts | 3 +++ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.env b/.env index 508e83d..b818b2e 100644 --- a/.env +++ b/.env @@ -10,11 +10,6 @@ # ---- Local Standalone Backend (FastAPI on Port 8000) ---- # For Local Web: http://localhost:8000/api # For Physical Mobile Devices: http://YOUR_LOCAL_IP:8000/api -<<<<<<< Updated upstream -EXPO_PUBLIC_API_URL=http://localhost:8000/api -EXPO_PUBLIC_BACKEND_PORT=8000 -EXPO_PUBLIC_MEDIA_BASE_URL=http://localhost:9000/ -======= # EXPO_PUBLIC_API_URL=http://localhost:8000/api # EXPO_PUBLIC_BACKEND_PORT=8000 # EXPO_PUBLIC_MEDIA_BASE_URL=http://localhost:9000/ @@ -22,10 +17,9 @@ EXPO_PUBLIC_MEDIA_BASE_URL=http://localhost:9000/ # old working .env file # Production Dev -EXPO_PUBLIC_API_URL=https://api.acupedia.in/api -EXPO_PUBLIC_STOREFRONT_URL=https://acupedia.in/store +# EXPO_PUBLIC_API_URL=https://api.acupedia.in/api +# EXPO_PUBLIC_STOREFRONT_URL=https://acupedia.in/store # Local Dev -# EXPO_PUBLIC_API_URL=http://localhost:8000/api -# EXPO_PUBLIC_STOREFRONT_URL=http://localhost:3000 ->>>>>>> Stashed changes +EXPO_PUBLIC_API_URL=http://localhost:8000/api +EXPO_PUBLIC_STOREFRONT_URL=http://localhost:3000 diff --git a/app.json b/app.json index 2e40272..a3ed173 100644 --- a/app.json +++ b/app.json @@ -19,7 +19,8 @@ }, "predictiveBackGestureEnabled": false, "package": "com.anonymous.acupedia", - "usesCleartextTraffic": true + "usesCleartextTraffic": true, + "allowBackup": false }, "web": { "output": "static", diff --git a/src/store/auth.store.ts b/src/store/auth.store.ts index 371c40c..819f14a 100644 --- a/src/store/auth.store.ts +++ b/src/store/auth.store.ts @@ -269,6 +269,9 @@ export const useAuthStore = create()( return; } setApiAccessToken(state?.accessToken ?? null); + if (state?.accessToken && state?.isAuthenticated) { + void useAuthStore.getState().refreshSession(); + } }, }, ), -- 2.34.1