Stirling-PDF/frontend/src/services
ConnorYoh 43887c8179
Fix/V2/unzip_images (#4647)
Method Usage by Context

| Context | Method Used | Respects Preferences | HTML Detection |

|------------------------------|-------------------------------------------------------|------------------------|----------------|
| Tools (via useToolResources) | extractZipFiles() →
extractWithPreferences() |  Yes |  Yes |
| Automation | extractAutomationZipFiles() → extractAllFiles() |  No
(always extracts) |  Yes |
| Manual Unzip | extractAndStoreFilesWithHistory() → extractAllFiles() |
 No (always extracts) |  Yes |
| Auto-Upload | extractAllFiles() directly |  No (always extracts) | 
Yes |

  Detailed Behavior Matrix

| Context | HTML Files | Auto-Unzip OFF | Within Limit | Exceeds Limit |
Notes |

|--------------------------|-------------|----------------|--------------|---------------|----------------------------------------|
| Tools (useToolResources) | Keep zipped | Keep zipped | Extract all |
Keep zipped | Respects user preferences |
| Automation | Keep zipped | Extract all | Extract all | Extract all |
Ignores preferences (automation needs) |
| Manual Unzip | Keep zipped | Extract all | Extract all | Extract all |
User explicitly unzipping |
| Auto-Upload | Keep zipped | Extract all | Extract all | Extract all |
User dropped files |

  Simplified Decision Flow

  ZIP File Received
      │
      ├─ Contains HTML? → Keep as ZIP (all contexts)
      │
      └─ No HTML
          │
          ├─ Tools Context
          │   ├─ Auto-unzip OFF? → Keep as ZIP
          │   └─ Auto-unzip ON
          │       ├─ File count ≤ limit? → Extract all
          │       └─ File count > limit? → Keep as ZIP
          │
          └─ Automation/Manual/Auto-Upload
              └─ Extract all (ignore preferences)

  Key Changes from Previous Version
  
| Entry Point | Code Path | skipAutoUnzip | Respects Preferences? | HTML
Detection? | Extraction Behavior |

|-----------------------------------------------|----------------------------------------------------------------------------------------|---------------|-----------------------|---------------------------|-------------------------------------------------------------------------|
| Direct File Upload (FileEditor, LandingPage) |
FileContext.addRawFiles() → fileActions.addFiles() | True |  No |  Yes
| Always extract (except HTML ZIPs) |
| Tool Outputs (Split, Merge, etc.) | useToolResources.extractZipFiles()
→ zipFileService.extractWithPreferences() | false |  Yes |  Yes |
Conditional: Only if autoUnzip=true AND file count ≤ autoUnzipFileLimit
|
| Load from Storage (FileManager) | fileActions.addStirlingFileStubs() |
N/A | N/A | N/A | No extraction - files already processed |
| Automation Outputs |
AutomationFileProcessor.extractAutomationZipFiles() →
zipFileService.extractAllFiles() | N/A |  No |  Yes | Always extract
(except HTML ZIPs) |
| Manual Unzip Action (FileEditor context menu) |
zipFileService.extractAndStoreFilesWithHistory() → extractAllFiles() |
N/A |  No |  Yes (blocks extraction) | Always extract (except HTML
ZIPs) - explicit user action |

---------

Co-authored-by: Connor Yoh <connor@stirlingpdf.com>
2025-10-15 14:17:44 +00:00
..
apiClient.ts Bugfix/V2/remove-timeout-on-fetch (#4510) 2025-09-26 15:36:41 +01:00
automationStorage.ts Feature/v2/automate (#4248) 2025-08-22 14:40:27 +01:00
documentManipulationService.ts Feature/v2/navigate save prompt (#4586) 2025-10-02 20:14:35 +01:00
enhancedPDFProcessingService.ts Feature/v2/navigate save prompt (#4586) 2025-10-02 20:14:35 +01:00
errorUtils.ts Feature/toasts and error handling (#4496) 2025-09-25 21:03:53 +01:00
fileAnalyzer.ts Enable ESLint no-unused-vars rule (#4367) 2025-09-05 11:16:17 +00:00
fileProcessingService.ts Enable ESLint no-unused-vars rule (#4367) 2025-09-05 11:16:17 +00:00
fileStorage.ts Feature/v2/filehistory (#4370) 2025-09-16 15:08:11 +01:00
fileStubHelpers.ts Feature/v2/navigate save prompt (#4586) 2025-10-02 20:14:35 +01:00
googleDrivePickerService.ts Feature/v2/googleDrive (#4592) 2025-10-09 10:22:17 +01:00
httpErrorHandler.ts Bugfix/V2/remove-timeout-on-fetch (#4510) 2025-09-26 15:36:41 +01:00
indexedDBManager.ts Feature/v2/toggle_for_auto_unzip (#4584) 2025-10-06 11:29:38 +00:00
pdfExportHelpers.ts Feature/v2/navigate save prompt (#4586) 2025-10-02 20:14:35 +01:00
pdfExportService.ts Feature/v2/navigate save prompt (#4586) 2025-10-02 20:14:35 +01:00
pdfMetadataService.ts V2 change metadata (#4433) 2025-09-18 09:41:39 +00:00
pdfProcessingService.ts Update PDF.js integration and dependencies (#4360) 2025-09-24 13:07:27 +01:00
pdfWorkerManager.ts Update PDF.js integration and dependencies (#4360) 2025-09-24 13:07:27 +01:00
preferencesService.ts Refactor user preferences (#4667) 2025-10-15 11:53:00 +01:00
processingCache.ts Stirling 2.0 (#3928) 2025-07-16 17:53:50 +01:00
processingErrorHandler.ts Stirling 2.0 (#3928) 2025-07-16 17:53:50 +01:00
signatureDetectionService.ts Booklet and server sign (#4371) 2025-09-23 11:24:48 +01:00
specialErrorToasts.ts Feature/toasts and error handling (#4496) 2025-09-25 21:03:53 +01:00
thumbnailGenerationService.ts Feature/v2/navigate save prompt (#4586) 2025-10-02 20:14:35 +01:00
zipFileService.ts Fix/V2/unzip_images (#4647) 2025-10-15 14:17:44 +00:00