infinitered / apisauce

Axios + standardized errors + request/response transforms.
MIT License
2.8k stars 184 forks source link

Android: no requests are being fired #326

Closed jameswagoner closed 3 months ago

jameswagoner commented 3 months ago

I have the Api class setup from the Ignite boiler plate and calling any methods do absolutely nothing when using Android emulator

async requestLogin(email: string, password: string): Promise<string | undefined> {
    // make the api call
    const response: ApiResponse<AccessTokenResponse> = await this.apisauce.post(
      `auth/login`,
      { email, password }
    )

    return response.data?.access_token
  }

I can console log before but nothing runs afterwards. I have Reactotron running and no logs whatsoever. Everything works on iOS however.

Tried without the async / await with no change. Tried a try / catch with no change.

Logging this.apisauce gives me an apisauce instance. baseURL is set.

I don't get it. No output or logging leaves me with nothing to go on. Hoping someone experienced this and can point out the obvious mistake I am making

jameswagoner commented 3 months ago

Okay, I knew this was going to be one of those dumb issues.

Blaming the emulator. I killed it and created a new one and worked after that. I suspect there was some network bridging issue with the previous emulator?

I'll leave this here if someone else in the future comes across this issue.