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
This commit is contained in:
Matthew Raymer
2025-06-14 09:44:07 +00:00
parent f7ed05d13f
commit 1529cc9689

View File

@@ -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(),
});