Skip to content

Commit 6a4d185

Browse files
authored
[0.80] AsyncStorageModule should not implement ModuleDataCleaner.Cleanable
This interface is now `internal` inside React Native (starting from 0.80) and will be removed in a future version of React Native. The methods `clearSensitiveData` was never called altogether so it's safe to remove.
1 parent 40c36cd commit 6a4d185

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

packages/default-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,14 @@
2424
import com.facebook.react.common.ReactConstants;
2525
import com.facebook.react.common.annotations.VisibleForTesting;
2626
import com.facebook.react.module.annotations.ReactModule;
27-
import com.facebook.react.modules.common.ModuleDataCleaner;
2827

2928
import java.util.ArrayDeque;
3029
import java.util.HashSet;
3130
import java.util.concurrent.Executor;
3231
import java.util.concurrent.Executors;
3332

3433
@ReactModule(name = AsyncStorageModule.NAME)
35-
public final class AsyncStorageModule
36-
extends NativeAsyncStorageModuleSpec implements ModuleDataCleaner.Cleanable {
34+
public final class AsyncStorageModule extends NativeAsyncStorageModuleSpec {
3735

3836
// changed name to not conflict with AsyncStorage from RN repo
3937
public static final String NAME = "RNCAsyncStorage";
@@ -87,14 +85,6 @@ public void invalidate() {
8785
mReactDatabaseSupplier.closeDatabase();
8886
}
8987

90-
@Override
91-
public void clearSensitiveData() {
92-
// Clear local storage. If fails, crash, since the app is potentially in a bad state and could
93-
// cause a privacy violation. We're still not recovering from this well, but at least the error
94-
// will be reported to the server.
95-
mReactDatabaseSupplier.clearAndCloseDatabase();
96-
}
97-
9888
/**
9989
* Given an array of keys, this returns a map of (key, value) pairs for the keys found, and
10090
* (key, null) for the keys that haven't been found.

0 commit comments

Comments
 (0)