Skip to content

fix: cannot select directory hangs on “Moving data” (Android) (#484) #498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

harikrishna-au
Copy link

Description

This PR fixes a bug where changing the data directory could hang on the "Moving data to new directory" screen and silently fall back to the default directory.

Key Changes

  • Guard SAF (Storage Access Framework) destinations
    Detect non-file-system targets and return a clear “not permitted” result instead of attempting a move that would hang/fail.
  • Skip Flutter runtime assets
    Avoid copying flutter_assets/kernel_blob.bin and other runtime files to prevent illegal copies.
  • Use context-free dialogs/snackbar via GetX
    Prevents use_build_context_synchronously issues after await calls.
  • Add success feedback
    Shows confirmation when a move completes successfully.
  • Android: enableOnBackInvokedCallback in Manifest
    Aligns with Android 13+ back behavior.

Behavior Notes

  • Moving to SAF-picked folders (content:// URIs) is now blocked with a friendly error.
    Full SAF directory write support can be added later using existing SAF utilities.
  • Moving to regular file-system directories works and shows success feedback.

Manual Test Plan

  1. Normal on-device directory
    • Move completes successfully
    • “Current directory” updates
    • Tasks persist in the new directory
  2. SAF tree (e.g., Downloads via system picker)
    • Operation is rejected with a clear message
    • No hang and no partial move
  3. Ensure no Flutter runtime files are copied.

Dependencies

None

Fixes

Fixes #484


Screenshots

N/A (UI unchanged apart from dialogs/snackbar)


Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

Notes:
Tests for SAF behavior and settings controller can be added in a follow-up PR (current CI doesn’t run tests).

…AF destinations; skip flutter runtime assets; use context-free dialogs; add success feedback (fixes CCExtractor#484)
@harikrishna-au
Copy link
Author

Screen.Recording.2025-08-15.at.12.40.21.AM.mp4

@JRadl @SGI-CAPP-AT2 review

@harikrishna-au
Copy link
Author

@SGI-CAPP-AT2, is there anything missed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot select directory
1 participant