Skip to content

Conversation

@cfsmp3
Copy link
Contributor

@cfsmp3 cfsmp3 commented Jan 1, 2026

Summary

  • Move config.json storage from Documents folder to the proper application support directory
  • Add timeout protection and error handling for settings initialization
  • Fixes app hanging on startup on Windows 11 25H2

Problem

Users on Windows 11 25H2 reported the app getting stuck on "Loading..." at startup (CCExtractor/ccextractor#1936). The root cause is that getApplicationDocumentsDirectory() can hang indefinitely when:

  • Documents folder is redirected to OneDrive and sync is not working
  • Enterprise policies redirect to network shares
  • Permissions issues with the Documents folder

Solution

  • Use getApplicationSupportDirectory() instead - this is the proper location for app config:
    • Windows: C:\Users\<user>\AppData\Roaming\<app>
    • macOS: ~/Library/Application Support
    • Linux: ~/.local/share
  • Add 10-second timeout on directory resolution
  • Ensure directory exists before writing (with recursive: true)
  • Wrap settings initialization in try-catch to emit error state instead of hanging silently

Test plan

  • flutter analyze passes
  • All 14 unit tests pass
  • Tested on Linux - app starts and settings work correctly
  • Needs testing on Windows 11 (especially 25H2)
  • Needs testing on macOS

🤖 Generated with Claude Code

Move config.json from Documents folder to the proper application
support directory (AppData\Roaming on Windows, ~/.local/share on Linux,
~/Library/Application Support on macOS).

This fixes the app hanging on startup on Windows 11 25H2 when the
Documents folder is inaccessible (OneDrive sync issues, permissions,
network redirects, etc.).

Changes:
- Use getApplicationSupportDirectory() instead of getApplicationDocumentsDirectory()
- Add 10-second timeout on directory resolution
- Ensure directory exists before writing config
- Add try-catch in SettingsBloc to emit error state instead of hanging

Fixes: CCExtractor/ccextractor#1936

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@cfsmp3 cfsmp3 merged commit a2998d0 into master Jan 1, 2026
7 checks passed
@cfsmp3 cfsmp3 deleted the fix/settings-storage-location branch January 1, 2026 09:18
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.

2 participants