Akavache icon indicating copy to clipboard operation
Akavache copied to clipboard

Data is not being cleared

Open fenix2222 opened this issue 7 years ago • 1 comments

Note: for support questions, please ask on StackOverflow: https://stackoverflow.com/questions/tagged/Akavache . This repository's issues are reserved for feature requests and bug reports.

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

I am using Akavache in Xamarin Forms. It runs fine on iOS, but on android I am getting strange behavior. If I delete app completely and re-deploy it, cache is still there. I am using "Uninstall for all users" option. I also unticked "Preserve data/cache between application deploys" in Prereferences -> Android Build. I also tried to call InvalidateAll on Blob Cache. Data is deleted, but when I redploy the app, old data is appearing again. It is impossible for me to debug or clear that data. I even tried proper shutdown to no avail.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

Use akavache in android app in xamarin forms. Delete app completely, call invalidateall on next startup. Close that all, open it again and all data is still coming up

What is the expected behavior?

Old data is gone forever.

What is the motivation / use case for changing the behavior?

I really need to be able to debug my new code and I cannot seem to find a way to remove old data.

Which versions of Akavache, and which platform / OS are affected by this issue? Did this work in previous versions of Akavache? Please also test with the latest stable and snapshot (https://www.myget.org/feed/Akavache/package/nuget/Akavache) versions.

Xamarin Forms, akavache v 5.0.0

Other information (e.g. stacktraces, related issues, suggestions how to fix)

fenix2222 avatar May 08 '17 11:05 fenix2222

FWIW I found a similar issue on UWP. I was using a customization of this: https://github.com/akavache/Akavache/blob/501b397d8c071366c3b6783aae3e98695b3d7442/src/Akavache.Sqlite3/Registrations.cs#L40 to change the name of the db file. At one point I changed the name of the file and magically, even after uninstall/reinstall of the app, the old AND the new "db" files would both show up in the cacheFolder location (and it seemed to pull data from the old file). Tracing through the Akavache repo I didn't see anything obvious and assumed the issue was further down in the Sqlite3 component. In the end I got around this by changing the cacheFolder to a different path temporarily, ran the app, then changed it back and re-installed the app.

EDIT: Meh...when I ran into this again on a different project that has the same kind of setup those steps didn't work. So not sure what the key was to get it working again other than tinkering with the cache folder used and different sequences of uninstalling.

DennisWelu avatar Jul 18 '17 19:07 DennisWelu