Akavache icon indicating copy to clipboard operation
Akavache copied to clipboard

[BUG] Xamarin.Android: InvalidateObject throws System.ArgumentNullException

Open chrisheeley20 opened this issue 3 years ago • 0 comments

Describe the bug

I am using an older version of Akavache (6.10.4) as using the latest gives me another exception : 'System.InvalidOperationException: Sequence contains no elements'

Here is my code: await BlobCache.UserAccount.InvalidateObject<CurrentUser>("currentUser");

where <CurrentUser> is my user model for the currently logged in user. When a user logs in it sets the cache with this command: await BlobCache.UserAccount.InsertObject("currentUser",currentUser); I have tried using it like this: await BlobCache.UserAccount.InsertObject<CurrentUser>("currentUser",currentUser); but it still did not work.

Steps To Reproduce

I do not know how to specifically reproduce this, it happens every time

Expected behavior

I expect this line to invalidate the currentUser Model currently stored in the cache

Screenshots

Environment

  • OS: Android
  • Device: Zebra TC56
  • Version: 7.1.2
  • Working Version:

Additional context

Here is my StackOverflow forum for the InvalidOperation Exception: https://stackoverflow.com/questions/71424303/xamarin-android-akavache-throwing-system-invalidoperationexception?noredirect=1#comment126261323_71424303

chrisheeley20 avatar Mar 11 '22 09:03 chrisheeley20