[Windows] Frequent Corruption of SecureStorage file
We have users who are losing access to their secure storage at seemingly random times, and I haven't been able to track down the issues using error logs alone. Sometimes I see errors in the logs, such as this one:
OSError: OS Error: The process cannot access the file because it is being used by another process.
, errno = 32
FileSystemException: PathAccessException: Cannot delete file, path = 'c:\users\user\appdata\roaming\inventory bot co\inventory bot\flutter_secure_storage.dat' (OS Error: The process cannot access the file because it is being used by another process.
, errno = 32)
#0 _checkForErrorResponse (dart:io/common.dart:56)
#1 _File._delete.<fn> (dart:io/file_impl.dart:315)
File "<asynchronous suspension>"
#3 DpapiJsonFileMapStorage.load (package:flutter_secure_storage_windows/src/flutter_secure_storage_windows_ffi.dart:280)
File "<asynchronous suspension>"
#5 FlutterSecureStorageWindows.read (package:flutter_secure_storage_windows/src/flutter_secure_storage_windows_ffi.dart:88)
File "<asynchronous suspension>"
And the user will report their storage is just fine. Why would it try to delete the file during a load?
And then I'll encounter this sequence of errors:
WindowsException: Error 0x0000000d: Failure on CryptUnprotectData()
#0 DpapiJsonFileMapStorage.load.<fn> (package:flutter_secure_storage_windows/src/flutter_secure_storage_windows_ffi.dart:241)
#1 using (package:ffi/src/arena.dart:124)
#2 DpapiJsonFileMapStorage.load (package:flutter_secure_storage_windows/src/flutter_secure_storage_windows_ffi.dart:216)
File "<asynchronous suspension>"
#4 FlutterSecureStorageWindows.read (package:flutter_secure_storage_windows/src/flutter_secure_storage_windows_ffi.dart:88)
File "<asynchronous suspension>"
which is almost always a "Fatal" indicator. that they will have to completely rebuild their settings.
How can I make this more resilient to this kind of corruption on Windows?
⚠️ This issue has been marked as stale because it has been open for 60 days with no activity.
If this issue is still relevant, please comment to keep it active. Otherwise, it will be closed in 60 days.
has this been fixed?
⚠️ This issue has been marked as stale because it has been open for 60 days with no activity.
If this issue is still relevant, please comment to keep it active. Otherwise, it will be closed in 60 days.