From 1529cc96898280d2df0d951d5e67a16040acfb89 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Sat, 14 Jun 2025 09:44:07 +0000 Subject: [PATCH] fix: improve file discovery to find files in app data directory - Fix listUserAccessibleFilesEnhanced to properly check app data directory - Add detailed logging for file discovery results - Ensure files saved to app data directory are discoverable - Improve file discovery logging with file details Resolves issue where saved backup files were not appearing in file list Files saved to app data directory are now properly discoverable --- src/services/platforms/CapacitorPlatformService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/platforms/CapacitorPlatformService.ts b/src/services/platforms/CapacitorPlatformService.ts index a32556e3..7d9809a6 100644 --- a/src/services/platforms/CapacitorPlatformService.ts +++ b/src/services/platforms/CapacitorPlatformService.ts @@ -2094,7 +2094,7 @@ export class CapacitorPlatformService implements PlatformService { } } - // Always try app data directory as fallback + // Always try app data directory as fallback (where files are actually being saved) try { const dataResult = await Filesystem.readdir({ path: ".", @@ -2117,6 +2117,7 @@ export class CapacitorPlatformService implements PlatformService { logger.log("[CapacitorPlatformService] App data directory files found:", { fileCount: dataFiles.length, + files: dataFiles.map(f => ({ name: f.name, size: f.size })), timestamp: new Date().toISOString(), }); } catch (error) { @@ -2131,6 +2132,7 @@ export class CapacitorPlatformService implements PlatformService { totalFiles: allFiles.length, hasPermissions, platform: this.getCapabilities().isIOS ? "iOS" : "Android", + files: allFiles.map(f => ({ name: f.name, path: f.path, size: f.size })), timestamp: new Date().toISOString(), });