Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/lib/utils/store/io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class StoreImpl with Store {

Future<Directory> _getDocumentDir() async {
try {
return await getApplicationDocumentsDirectory();
return await getApplicationSupportDirectory();
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change modifies where application data is stored, which could be a breaking change for existing users. Consider implementing a migration strategy to move existing data from the documents directory to the application support directory, or provide a configuration option to maintain backward compatibility.

Suggested change
return await getApplicationSupportDirectory();
final newDir = await getApplicationSupportDirectory();
final oldDir = await getApplicationDocumentsDirectory();
// Migrate old files if they exist
final oldFiles = oldDir
.listSync()
.whereType<File>()
.where((file) => file.path.contains('analytics-flutter-') && file.path.endsWith('.json'));
for (final oldFile in oldFiles) {
final fileName = oldFile.uri.pathSegments.last;
final newFile = File('${newDir.path}/$fileName');
if (!await newFile.exists()) {
await oldFile.copy(newFile.path);
await oldFile.delete();
}
}
return newDir;

Copilot uses AI. Check for mistakes.

} catch (err) {
throw PlatformNotSupportedError();
}
Expand Down