react-native-google-signin / google-signin

Google Sign-in for your React Native applications
https://react-native-google-signin.github.io/
MIT License
3.23k stars 881 forks source link

[Intermittent] Unable to use addScopes in Android #1338

Closed williamliangwl closed 1 month ago

williamliangwl commented 1 month ago

I have searched open and closed issues for this issue.

This is not a bug report for DEVELOPER_ERROR

Minimal reproducible example

-

What platform(s) does this occur on?

Android

Summary

We were using combination of 2 libraries to have the feature of uploading file to Google Drive:

What we did was:

  1. Call configure without the Google Drive scope, because in other part of our app, the intention of our user is purely just for sign in, so it would be weird to ask for Google Drive access on that part
  2. Call signInSilently, if it fails, call signIn
  3. Call addScopes
  4. Call getTokens to get the access token
  5. Use the access token for google drive related operation

We were using version 10.0.1 up until 2 weeks ago, we upgraded to version 12.2.1. Starting from last Friday, several Android users are complaining that they are unable to upload and read file from GDrive. Upon checking, we detected that somehow the addScopes doesn't give any error, but when we log its return, which is the Google user, doesn't have the added scopes

Due to the missing scopes, the query to Google Drive API is rejected with code 403.

However, this issue is not happening to all users, only to several devices, but we are not able to detect the pattern. The impacted users are varied by OS version, Google Play Services, and device model.

We have tried the followings but still encountered the issue:

What we have tried and solved the issue, but not ideally:

Just wondering if there's any clue from your perspective to properly fix the issue

Your computer environment


System:
  OS: macOS 14.5
  CPU: (10) arm64 Apple M1 Pro
  Memory: 1.66 GB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.19.0
    path: ~/.nvm/versions/node/v18.19.0/bin/node
  Yarn:
    version: 3.6.4
    path: ~/.nvm/versions/node/v18.19.0/bin/yarn
  npm:
    version: 10.2.3
    path: ~/.nvm/versions/node/v18.19.0/bin/npm
  Watchman:
    version: 2024.08.05.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK:
    API Levels:
      - "27"
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 26.0.3
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-26 | Google APIs ARM 64 v8a
      - android-27 | ARM 64 v8a
      - android-29 | Google Play ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
      - android-33 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.1 AI-221.6008.13.2211.9514443
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /Users/pintu/.sdkman/candidates/java/current/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.3
    wanted: 0.74.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false```
williamliangwl commented 1 month ago

for some reason, without doing anything, the addScope now works properly

anyone know if there's a status page of Google SignIn related? or any community related to it?

vonovak commented 1 month ago

Hello and thanks for reporting, unfortunately there's not much I can do about intermittent issues caused by remote apis. Unfortunately I'm not aware of a status page other than https://status.cloud.google.com/. Thank you 🙂