Skip to content
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

Inconsistent error code for getIdToken iOS vs Android, when device offline #3654

Closed
2 of 10 tasks
draperunner opened this issue May 15, 2020 · 3 comments · Fixed by #3655
Closed
2 of 10 tasks

Inconsistent error code for getIdToken iOS vs Android, when device offline #3654

draperunner opened this issue May 15, 2020 · 3 comments · Fixed by #3655

Comments

@draperunner
Copy link
Contributor

draperunner commented May 15, 2020

Issue

I am trying to fetch the ID token for the currentUser. If the device has been offline long enough for the token to have expired, and still is offline when calling getIdToken, the method will throw an error. On iOS this error has the code auth/network-request-failed, which is expected. On Android though, it's just auth/unknown. The error.message is [auth/unknown] A network error (such as timeout, interrupted connection or unreachable host) has occurred.

I would expect the error code on Android to also be auth/network-request-failed in this case.


Project Files

Javascript

Click To Expand

package.json:

# N/A

firebase.json for react-native-firebase v6:

# N/A

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
# N/A

AppDelegate.m:

// N/A


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->


Environment

Click To Expand

react-native info output:

System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Memory: 179.82 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.13.0 - ~/.nvm/versions/node/v10.13.0/bin/node
    Yarn: 1.22.4 - ~/.yvm/shim/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v10.13.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 23, 25, 26, 27, 28
      Build Tools: 23.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.3, 28.0.2, 28.0.3
      System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-25 | Google APIs Intel x86 Atom_64, android-25 | Google Play Intel x86 Atom, android-26 | Google APIs Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
      Android NDK: 17.1.4828580
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6308749
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: ^0.61.5 => 0.61.5
  npmGlobalPackages:
    react-native: 0.61.5
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
  • Firebase module(s) you're using that has the issue:
    • auth
  • Are you using TypeScript?
    • N


@Salakar
Copy link
Contributor

Salakar commented May 15, 2020

Thanks for the report! PR is up with a fix - waiting for CI and then this will be available on the '7.0.2' release of the Auth package.

FYI: 6.7.1 to ^7.0.0 upgrade has no breaking changes - major version was to internally signify some versioning changes for how we release the packages going forwards (all versioned independently now - so faster release cycles).

Salakar added a commit that referenced this issue May 15, 2020
@Salakar
Copy link
Contributor

Salakar commented May 15, 2020

@draperunner Auth v7.0.2 is up with this - thanks for the report :)

0197ba7

@draperunner
Copy link
Contributor Author

Great, thanks!

stefkampen pushed a commit to stefkampen/react-native-firebase that referenced this issue Jun 6, 2020
androidIsForVivek pushed a commit to androidIsForVivek/react-native-firebase that referenced this issue Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants