Skip to content

Archive extraction broken for remote providers (Google Drive, SMB) #196

@BrianLeishman

Description

@BrianLeishman

Summary

Extracting archive files (zip, etc.) on remote providers like Google Drive doesn't work properly. It shows an error, displays a non-functional progress window, then unexpectedly opens Finder.

Current State

  • File: src/store/useAppStore.ts:1300-1421 (extractArchive function)
  • Google Drive extraction flow exists at lines 1342-1421
  • The code attempts to:
    1. Get the destination folder ID
    2. Call extract_gdrive_archive backend command
    3. Show progress window after 500ms delay
    4. Refresh directory on completion

Current behavior (broken):

  1. User double-clicks a zip file on Google Drive
  2. Error appears (unclear what error)
  3. Progress window shows but doesn't reflect actual progress
  4. Finder opens for some reason (likely fallback behavior at line 1493: await openShell(file.path))
  5. Archive is not extracted

Code flow issue:

} catch (error) {
  // ... error handling ...
  try {
    await openShell(file.path);  // <-- This opens Finder with the gdrive:// path
    return false;
  } catch (openErr) {
    // ...
  }
}

The fallback openShell(file.path) on a gdrive:// path doesn't make sense and causes Finder to open.

Proposed Changes

Option A: Disable extraction for remote providers (quick fix)

  • Show a clear message: "Archive extraction is not yet supported for Google Drive. Download the file first."
  • Don't show progress window or attempt extraction
  • Don't fall back to opening in Finder

Option B: Implement proper remote extraction (full fix)

  1. Download archive to temp directory
  2. Extract locally
  3. Upload extracted contents back to remote
  4. Show accurate progress (download → extract → upload phases)
  5. Clean up temp files

Immediate fixes needed:

  • Don't call openShell() with remote paths on failure
  • Either disable the feature cleanly or implement it properly
  • Progress window should reflect actual state or not appear at all

Technical Notes

  • extract_gdrive_archive command exists in backend: src-tauri/src/commands.rs
  • Progress window: src/windows/ArchiveProgressWindow.tsx
  • Archive progress store: src/store/useArchiveProgressStore.ts
  • Similar issue likely affects SMB paths

Acceptance Criteria

  • No confusing error + progress + Finder behavior
  • Clear user feedback on what's happening
  • Either: extraction works end-to-end, OR clear message that it's not supported
  • No fallback to openShell() with remote paths

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions