# React Native NCW SDK - Recovery Issue: No callback found for operation

**URL:** <https://community.fireblocks.com/t/react-native-ncw-sdk-recovery-issue-no-callback-found-for-operation/1601>\
**Category:** Developer Discussion\
**Created:** [November 13, 2024, 7:18pm UTC](https://community.fireblocks.com/t/react-native-ncw-sdk-recovery-issue-no-callback-found-for-operation/1601 "2024-11-13T19:18:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mb\_rehive](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@mb\_rehive](https://community.fireblocks.com/u/mb_rehive)\
**Post date:** [November 13, 2024, 7:18pm UTC](https://community.fireblocks.com/t/react-native-ncw-sdk-recovery-issue-no-callback-found-for-operation/1601/1 "2024-11-13T19:18:23Z")

</div>

Hi,

We are running into issues with the React Native NCW SDK on Android.

This is the relevant code extracted from our project:

```auto
const passphrase = await gdriveRecover({
  token: accessToken,
  passphraseId: googleDrivePassphrase.uuid
});

if (!passphrase) {
  throw new Error('No passphrase found for the given ID.');
}

// Callback function that returns the passphrase
const passphraseResolver = async (passphraseId: string): Promise<string> => {
  console.log('Passphrase callback was called with ID:', passphraseId);
  return passphrase;
};
const result = sdk.recoverKeys(passphraseResolver);
console.log('Recover keys result:', result);

```

Recovery is running perfectly on iOS with the exact same code, but on Android it throws the following error:

```auto
 (NOBRIDGE) DEBUG gdrive getting file... 1MleRNe7TubdXNl05UhJP6j63ADRSwBsZsbfBzDT3v9hvdx7ljQ
 (NOBRIDGE) DEBUG outgoingMessage called! {"deviceId": "aaa03fd4-4460-4dec-9046-7cc3b2e173de", "opId": 36}
 (NOBRIDGE) LOG baseUrl https://fireblocks-testnet.services.rehive.com/api/ncw
 (NOBRIDGE) LOG path api/devices/aaa03fd4-4460-4dec-9046-7cc3b2e173de/rpc
 (NOBRIDGE) LOG body {"message": "{\"headers\":{\"physicalDeviceId\":\"8468ee93-5a22-42ce-a774-e9aac8803f09\",\"platformType\":\"Android\",\"sdkVersion\":\"2.9.1.173\",\"mpcVersion\":\"6\"},\"method\":\"get_backup\",\"params\":[]}"}
 (NOBRIDGE) ERROR outgoingMessage error [Error: No callback found for operation 36]
 (NOBRIDGE) WARN Possible Unhandled Promise Rejection (id: 0):
Error: No callback found for operation 36
 (NOBRIDGE) DEBUG sdk_event called! {"keyDescriptor": {"algorithm": "null", "keyId": null, "keyStatus": "ERROR"}, "type": "keys_recovery"}
 (NOBRIDGE) LOG Recover keys result: undefined

```

This is when running in the Android Simulator: Pixel 9 API 35. See screen recording below:  
 ![short-recovery-failure](https://us1.discourse-cdn.com/flex015/uploads/fireblocks/original/1X/c8476847aa5e80046199787e32c01bb09c0b5d2e.gif)

On the older Pixel 3 API 33 simulator and some physical android, we get similar callback errors even for the backup flow (not only recovery). Both backup and recovery run fine with the same code on iOS.

This is with

```auto
dependencies {
    implementation "com.fireblocks.sdk:ncw:2.9.1"
    ...
}

```

---

<div class="post-metadata">

**Author:** ![golan](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@golan](https://community.fireblocks.com/u/golan)\
**Post date:** [November 28, 2024, 3:03pm UTC](https://community.fireblocks.com/t/react-native-ncw-sdk-recovery-issue-no-callback-found-for-operation/1601/2 "2024-11-28T15:03:51Z")

</div>

Hello,

Please provide more information - on how you create/initialize the SDK? are you using more than one SDK instance?  
please share the code here.

---

<div class="post-metadata">

**Author:** ![mb\_rehive](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@mb\_rehive](https://community.fireblocks.com/u/mb_rehive)\
**Post date:** [December 2, 2024, 11:22am UTC](https://community.fireblocks.com/t/react-native-ncw-sdk-recovery-issue-no-callback-found-for-operation/1601/3 "2024-12-02T11:22:32Z")

</div>

Hi @golan,

We’re initializing only one SDK instance and are initializing it with the following code:

```auto
      const secureStorageProvider = new EncryptedSecureStorage(deviceId);

      const messagesHandler = {
        handleOutgoingMessage: (message: string) => {
          if (!deviceId) throw new Error("Device ID not set");
          if (!authUser.token) throw new Error("Authentication token not available");
          return apiService.sendMessage({ deviceId: deviceId, message: message, token: authUser.token });
        },
      };

      const eventsHandler = {
        handleEvent: (event: TEvent) => {
          switch (event.type) {
            case "key_descriptor_changed":
              setKeysStatus((prevStatus) => 
                prevStatus ? {
                  ...prevStatus,
                  [event.keyDescriptor.algorithm]: event.keyDescriptor,
                } : null
              );
              break;
          }
        },
      };

      const newSdk = await FireblocksNCWFactory({
        env: (process.env.EXPO_PUBLIC_NCW_SDK_ENV as TEnv) || 'sandbox',
        logLevel: "INFO",
        deviceId,
        messagesHandler,
        eventsHandler,
        secureStorageProvider,
      });

```

However, when I ran the same test today on the exact same build (with SDK 2.9.1), suddenly the error is no longer occurring.

Is it possible something changed on your backend for the sandbox environment? Because previously recovery was consistently failing for Android and now at least in my last three tests it is succeeding.

---

<div class="post-metadata">

**Author:** ![golan](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@golan](https://community.fireblocks.com/u/golan)\
**Post date:** [December 17, 2024, 3:00pm UTC](https://community.fireblocks.com/t/react-native-ncw-sdk-recovery-issue-no-callback-found-for-operation/1601/4 "2024-12-17T15:00:41Z")

</div>

Hi,  
We continuously work on improving our infrastructure; however, we are not aware of any recent backend changes or fixes that would explain this change in behavior.
