Update from SDK28 to SDK32 Session Issues

I’m getting a weird issue when I try to upgrade from SDK28 to SDK32.

On SDK28 the communication between clients and backend works perfectly, I auth the client, the backend generates the session ID which is sent per request and everything gets validated.

However, when I upgrade to v32, the session key seems to get lost. Every request I make to the backend has a session id NULL, which prevents the client to work properly since the backend sends back that the client is not logged in.

Just in case it is useful, I made my backend in Ruby on Rails.

I have read the breaking changes from V29 - 32 but can’t find something related that can affect this.
If I rollback to 28 everything works correctly.

Have anyone seen something similar?

Hey @jciccio, sorry you’re running into this issue. I can’t say I’ve seen it before :confused:

Maybe with a little bit more info (if that’s possible) you might get some help in troubleshooting it? Another option is to test it on SDK 31 and see if that works, but SDK 32 doesn’t?

Hi, @charliecruzan yes, it’s really weird.

Yes it’s a bit hard to give more details, since the api calls work pretty much the same (as the backend remains unchanged). The only difference is the Expo SDK.

Just in case this helps, this is how my app.json looks:

{
  "expo": {
    "name": "X",
    "description": "Desc.",
    "slug": "X",
    "privacy": "public",
    "sdkVersion": "32.0.0",
    "platforms": [
      "ios",
      "android"
    ],
    "version": "0.0.1",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "myId"
    },
    "android": {
      "package": "myId"
    }
  }
}

And these is the package.json I’m using:

{
  "main": "node_modules/expo/AppEntry.js",
  "private": true,
  "dependencies": {
    "ex-react-native-i18n": "0.0.5",
    "expo": "^32.0.6",
    "i18next": "^16.0.0",
    "i18next-xhr-backend": "^3.0.0",
    "lottie-react-native": "^2.6.1",
    "moment": "^2.24.0",
    "moment-timezone": "^0.5.25",
    "native-base": "^2.12.1",
    "react": "16.5.0",
    "react-i18next": "^9.0.10",
    "react-moment": "^0.8.3",
    "react-native": "https://github.com/expo/react-native/archive/sdk-32.0.3.tar.gz",
    "react-native-calendar-strip": "^1.3.8",
    "react-native-calendars": "^1.172.0",
    "react-native-collapsible": "^1.4.0",
    "react-native-elements": "^0.19.1",
    "react-native-gifted-chat": "^0.4.3",
    "react-native-languages": "^3.0.2",
    "react-native-map-link": "^2.4.0",
    "react-native-material-dropdown": "^0.11.1",
    "react-native-modal-datetime-picker": "^7.4.2",
    "react-native-popup-dialog": "^0.18.2",
    "react-native-tab-navigator": "^0.3.4",
    "react-native-vector-icons": "^4.6.0",
    "react-native-webview": "~5.11.0",
    "react-navigation": "~2.3.1",
    "react-redux": "^5.0.6",
    "redux": "^3.7.2",
    "redux-thunk": "^2.2.0",
    "sentry-expo": "~1.11.2",
    "webpack": "^4.32.2"
  }
}

Tried with:
“sdk-32.0.3.tar.gz”,
“sdk-32.0.2.tar.gz”,
“sdk-32.0.1.tar.gz”,
“sdk-32.0.0.tar.gz”

Having the same results

One thing noticed is that after the upgrade had these warnings:

npm WARN expo-google-sign-in@2.0.0 requires a peer of react-native@^0.55.4 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-reanimated@1.0.0-alpha.11 requires a peer of react@16.0.0-alpha.6 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-reanimated@1.0.0-alpha.11 requires a peer of react-native@^0.44.1 but none is installed. You must install peer dependencies yourself.

had another one, which s why I added webpack.

SDK31 gives me the same issue unfortunately (in fact have even more errors)
Not sure If there’s any other info I can give you on this that can help

I fixed the issue.
Just in case another soul has the same issue let me explain:

This issue was introduced in React Native 0.56 (prior versions don’t have this issue).
I’m using Ruby on Rails as backend (but it doesn’t really matter the language you’re using), the important part is that it works as an API only.

When doing fetch, credentials (aka session vars or cookies are not being sent).

In order to send them it is needed to include credentials: 'include',in the fetch function.

i.e

fetch (url,{
method: 'GET',
credentials: 'include',
...
})
2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.