mCodex/react-native-sensitive-info

[IOS] Protected data not available yet. Retry operation

Miyagee opened this issue ยท 16 comments

We started to get a lot of Protected data not available yet. Retry operation from our ios users.

It is happening for ios users above 14.6 while the majority of the problems come from ios 15.x. Does anyone know what could be causing the problem? We're on 6.0.0-alpha.9

I have the same problem.. did you find a solution @Miyagee?

Not really, we reduced our number of concurrent async operations which reduced the occurrences. But they still occur.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

I've suddently started getting this error too, even though I have not updated my codebase

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Any updates about this one ? Getting the same issue for iOS 15.X Thanks for your work guys!

I'm also still getting this error. Any updates yes?

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

I'm also getting this error. Any updates?

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

So, any updates? Because I'm still experiencing this issue and I did expect some updates after more than a year to be honest.

Currently facing the same issue and @Pickleboyonline I don't think the post you have suggested is related to this issue. This issue is related to background capability of the app. @ricardodolnl were you able to resolve this?

@sourabhdadapure i found this in the code

// TODO: could change to instead of erroring out, listen for protectedDataDidBecomeAvailable and call getItemWIthQuery when it does
and that made me think of catching the error and just retrying to get the data. It's not the cleanest solution but it does work for now:

let getDataAttempts = 0;

const getUserData = async () => {
  try {
    const refreshToken = await SInfo.getItem('refreshToken', {});
  } catch (e) {
    if (e.code === 'protected_data_unavailable') {
      if (getDataAttempts < 10) {
        // Retry getting item after 300ms for max 10 attempts.
        setTimeout(() => {
          getUserData();
        }, 300);
      } else {
        // Do something after 10 failed attempts, like logging out.
      }

      getDataAttempts++;
    }
  }
};

Re-pinging this thread to see if there's any update here?

Any news here?