Open pmigliore opened 5 months ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
I can repro this issue on the latest 17.11.0 Preview 2.1 (8.0.60 & 8.0.40 & 8.0.21).
@ninachen03, @samhouts Hey, I think this should always return null.
SetAsync is used to save value TeskKey to key TestKey. GetAsync after is calling for key TeskKey but this key won't exist because SetAsync for this key was never used.
Key | Value |
---|---|
TestKey | TeskKey |
TeskKey | null |
For a relevant test you should call var val = await SecureStorage.GetAsync("TestKey");
(this case tested on 8.0.82 - requested was for 8.0.40 SR5): Physical Device API 31
Emulator API 30
I believe this issue should be propably tagged as (s/needs-info) because it looks like it's no more needed.
Description
If I set a value in the SecureStorage
await SecureStorage.SetAsync("TestKey", "TestValue")
during the first app startup, and then return the valueawait SecureStorage.GetAsync("TestKey")
, the value is returned correctly. But if I close the app, even from running in the background, and restart it a second time, and callawait SecureStorage.GetAsync("TestKey")
, then it returns null. But if I set the value again, then it starts working successfully, and returns the value corectly if I restart the app a third time and so on.Steps to Reproduce
Task.Run(async () => { await SecureStorage.SetAsync("TestKey", "TeskKey"); var val = await SecureStorage.GetAsync("TeskKey"); });
and add a breakpoint in the last line of code.await SecureStorage.SetAsync("TestKey", "TeskKey");
.Link to public reproduction project repository
No response
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 12 and below
Did you find any workaround?
No
Relevant log output