[BUG] Data not stored properly in flutter_secure_storage: ^10.0.0-beta.4 on some devices
After upgrading to flutter_secure_storage: ^10.0.0-beta.4, we observed that the data written using write() is not being stored or retrieved properly on some devices. This leads to critical app functionality failures and makes the app unusable in production.
Steps to Reproduce:
- Upgrade to flutter_secure_storage: ^10.0.0-beta.4
- Write any value using storage.write(key: ..., value: ...)
- Try to read the same value using storage.read(key: ...)
- On some devices, it returns null instead of the written value
Expected Behavior: The written value should persist securely and be retrievable on all devices, as it does in version ^9.2.2.
Actual Behavior: Values are not being stored or retrieved correctly on some devices.
Affected Devices:
- Moto G32 (Android)
- OnePlus (Android)
- Some Android emulators
Same behaviour on Xiaomi Redmi Note 11 Pro Thank you for fixing
Same behaviour for Xiaomi 11 Lite 5G NE It's a real critical bugs as it's the primary role of the package Thank you for fixing
Same behaviour on Sony XQ-EC72 Thank you for fixing
Same behaviour on Pixel 7. Thank you for fixing
Yeah i recently notice this as well. Was there any undocumented changes we aren't aware of? I can reproduced it on
- Samsung Galaxy Z Fold6
- Samsung Galaxy Z Flip6
I wasn't aware of this issue at all until last week when users with said device reported that their app wasn't functioning properly, took me a while to debug and found out since we have re-fetch value via API as backup procedure so it wasn't clearly seen until an user manage to produced it.
iPhone 13 as well
@famasf1 did you manage to handle this issue? I also receive reports from users, but unfortunately I was not able to reproduce the behavior yet.
@juliansteenbakker is the package still maintained ?
@famasf1 did you manage to handle this issue? I also receive reports from users, but unfortunately I was not able to reproduce the behavior yet.
Not really. For now, I put data saving logic into related features, making it essentially save the same data twice. No feedback yet so I assumed it worked well enough for the time being.
Similarly on our application users started reporting problems after upgrading to V10 on some Android devices, we couldn't reproduce the issue on our models. Downgrading to v9 fixed the issue for them.
Same behaviour on
- Redmi Note 13
- Xiaomi 14T Pro
- Mi 9T Pro
- Galaxy A03
- Galaxy S21 5G
- Pixel 8
- Pixel 7
- Infinix HOT 40i
- Infinix HOT 30i
We are experiencing the same issue on Samsung A-series
I don't have a device to repro on, but I've had users with this issue.
Could someone with a device help test what exactly is happening? 🙏🏾 Specifically
- Can you reliably write a key and then subsequently not be able to read it?
- If so, can you try writing the key, and then doing a readAll? Curious if the key is being written incorrectly or not at all
I'd be keen to dive in and figure out the exact issue here, as it is affecting my in-app oauth flow 😢 https://github.com/ThexXTURBOXx/oauth2_client/issues/11
I ran into the same problem on Samsung.
I will only add that the first installation works fine. Backup is enabled on the phone. After reinstalling the application, secure storage stops sending data, while there are no errors when calling write.
Version: 10.0.0-beta.4,
We have version 10.0.0-beta.5 out right now, which has lots of changes on the android side. Could you try and test it with that version?
We have version 10.0.0-beta.5 out right now, which has lots of changes on the android side. Could you try and test it with that version? @juliansteenbakker
Checked several times for 10.0.0-beta.5 and it seems the error has really gone away. I note that I have a Samsung A50 and the backup of application data is enabled on the device.