Skip to content

[0.80] AsyncStorageModule should not implement ModuleDataCleaner.Cleanable #1205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/curly-carrots-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@react-native-async-storage/async-storage": minor
---

Fix support for React Native 0.80
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,14 @@
import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.annotations.VisibleForTesting;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.modules.common.ModuleDataCleaner;

import java.util.ArrayDeque;
import java.util.HashSet;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

@ReactModule(name = AsyncStorageModule.NAME)
public final class AsyncStorageModule
extends NativeAsyncStorageModuleSpec implements ModuleDataCleaner.Cleanable {
public final class AsyncStorageModule extends NativeAsyncStorageModuleSpec {

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

@Override
public void clearSensitiveData() {
// Clear local storage. If fails, crash, since the app is potentially in a bad state and could
// cause a privacy violation. We're still not recovering from this well, but at least the error
// will be reported to the server.
mReactDatabaseSupplier.clearAndCloseDatabase();
}

/**
* Given an array of keys, this returns a map of (key, value) pairs for the keys found, and
* (key, null) for the keys that haven't been found.
Expand Down
Loading