Skip to content

[Bug] Unity Firebase Functions error codes different on iOS than Android #393

Open
@steve6t6

Description

@steve6t6

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2021.2.15f1
  • Firebase Unity SDK version: 9.0.0
  • Source you installed the SDK: (.unitypackage or Unity Package Manager)](https://firebase.google.com/download/unity)
  • Problematic Firebase Component: Functions
  • Other Firebase Components in use: Auth, Database, Storage, Crashlytics, Remote Config.
  • Additional SDKs you are using: Infinity Maps, Easy Mobile (2.17.4)
  • Platform you are using the Unity editor on: Mac.S
  • Platform you are targeting: iOS, Android,
  • Scripting Runtime: IL2CPP
  • Pre-built SDK from the website

[REQUIRED] Please describe the issue here:

Since upgrading from Firebase 7.2.0 to 9.0.0 we have found that Function errors are no longer working as expected on iOS. Specifically we have a Firebase function that normally returns an error code of "notfound" after we cast the Task error as:
FunctionsException fbEx = task.Exception.InnerException.GetBaseException() as FunctionsException;
This was returning "notfound" on iOS before the 9.0.0 upgrade but now returns "internal", Android continues to return the expected error code.

(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)

Steps to reproduce:

Build a project using Firebase 7.2.0 and invoke a function that would be expected to return the error code "notfound" and observe the result occurring on Android and iOS devices.
Upgrade to Firebase Unity SDK 9.0.0 and observe that iOS now only returns the error "internal" where once it return "notfound".

Additional: After further testing we compared iOS and Android errors buy forcing errors with known return types, We have a cloud function that returns "Already Exists" when trying to redeem a code, Android returns the formatted error message in the .message property and has an error code of "alreadyexists". On iOS we get the correct .message but we get the error code "notfound". Further to this we have another cloud function that should return "Not Found" when using another code, Android shows the correct .message and .errorcode in the returned error, but iOS returns "One or more errors occurred (INTERNAL)" and the error code "internal".

This testing seem to show error codes for iOS are a bit random, [EDIT] FunctionsException issues we faced were due to a nested Task, the Firebase functions do return FunctionsExceptions.

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)?
No, not had time yet.

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.

Relevant Code:

// TODO(you): code here to reproduce the problem

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions