Async-storage: Updated to version 1.8.0 but data doesn't copy

Created on 25 Feb 2020  ·  14Comments  ·  Source: react-native-async-storage/async-storage

Current behavior

The warning says:
Failed to copy old storage directory to new storage directory location during migration: Error Domain=NSCocoaErrorDomain Code=4 "The file "RCTAsyncLocalStorage_V1" doesn't exist""

Environment

  • Async Storage version: 1.8.0
  • React-Native version: 0.61.5
  • Platform tested: iOS

All 14 comments

I got the same issue

Yes, we're aware of the issue,
Here's the PR that fixes that:
https://github.com/react-native-community/async-storage/pull/303

I got the same issue

Version v1.8.1 is released, please try that one

Upgraded to 1.8.1 (coming from 1.6.3), but the data is still not migrated.

use the v1.7.1.

use the v1.7.1.

Not really an option to stay on an old version forever because the migration does not work?

@ck86
Can you give some more hints of what you see?

@ck86
Can you give some more hints of what you see?

Somehow on my first try to upgrade from <1.8 to 1.8.1 failed, but later on it worked. I don't know why.

Unfortunately we already published an app with 1.8.0 where the migration failed.
I will now publish another version which the app tries to migrate the old data manually by checking whether the manifest.json exist or not in "RCTAsyncLocalStorage_V1" directory.

Unfortunately we already published an app with 1.8.0 where the migration failed.

Sorry to hear that.

I will now publish another version which the app tries to migrate the old data manually by checking whether the manifest.json exist or not in "RCTAsyncLocalStorage_V1" directory.

In your case, publishing version with AsyncStorage 1.8.1 won't work?

As far as I understood is that AsyncStorage >= 1.8 will not migrate old data when the manifest.json already exists in the new directory (Application Support/com.example/...?)

I'm afraid so, in that scenario, the migration is "done".

I think we only check if RCTAsyncLocalStorage_V1 directory is created there, instead checking if manifest.json is in place. Not sure if manifest.json check would change anything in this situation.

Not sure what is actually checked, but this is what was mentioned in the release:

This feature also includes a migration process. On app startup, a check is run to see if Application Support contains the manifest file:

  • If it does, do nothing
  • if it does not, copy over the manifest from previous location (either NSDocumentDirectory or NSCachesDirectory)

Anyway, when the new storage location is used the old one is not checked anymore. I could switch between my Apps in Testflight and saw different states of the app.

Regardless of my issue which I solved by manually migrating the data, I think 1.8.1 fixed this issue. :)

Was this page helpful?
0 / 5 - 0 ratings