Browse Source

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
capacitor-local-save
Matthew Raymer 1 day ago
parent
commit
1529cc9689
  1. 4
      src/services/platforms/CapacitorPlatformService.ts

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

Loading…
Cancel
Save