Skip to content

Unity editor rounds down floats to integers when retrieved from realtime database when locale is not en_US.utf8 #310

@Havard-SL

Description

@Havard-SL

Please fill in the following fields:

Unity editor version: 2019.2.6f1, 2019.2.10f1, 2019.3.0b10, 2020.1.0a12
Firebase Unity SDK version: 6.6.0
Firebase plugins in use: Only Database
Additional SDKs you are using: None
Platform you are using the Unity editor on: Linux, ubuntu 19.10 on two different machines
Platform you are targeting (iOS, Android, and/or desktop): Android
Scripting Runtime (Mono, and/or IL2CPP): Mono (I believe)

Please describe the issue here:

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

  1. Create a new firebase realtime database.
  2. Create a new floating point value
  3. Try to retrieve that value - it will be rounded down.

Here is an example script that you can just attach to any object that gets loaded and test the issue:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using Firebase;
using Firebase.Unity.Editor;
using Firebase.Database;

public class test: MonoBehaviour {
  void Start() {
    // Set this before calling into the realtime database.
    FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://unity-test-9f7cc.firebaseio.com/");
    
    DatabaseReference reference = FirebaseDatabase.DefaultInstance.RootReference;
    Debug.Log("Aigt imma head in");
        FirebaseDatabase.DefaultInstance
      .GetReference("test")
      .GetValueAsync().ContinueWith(task => {
        if (task.IsFaulted) {
          // Handle the error...
          Debug.Log("Error");
        }
        else if (task.IsCompleted) {
          DataSnapshot snapshot = task.Result;
          // Do something with snapshot...
          Debug.Log(snapshot);
        }
      });
  }
}

Expected output: "Aight imma head in" and "key:"test",value:2.69"
Tested output: "Aight imma head in" and "key:"test",value:2"

Could this be linked to the fact that i have (quite disgustingly) downloaded the libssl.1.0.2 and install it in order to circumvent this issue:

https://forum.unity.com/threads/empty-log-errors-in-2019-1-0f2.669961/
https://issuetracker.unity3d.com/issues/linux-roslyn-fails-if-there-is-a-newer-libssl-than-1-dot-0

Because ubuntu 19.04 and newer come with libssl-1.1.0, and there is no libssl-1.0.0 in the repositories.

Please answer the following, if applicable:

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)?
Sorry, I have not tried.

What's the issue repro rate? (eg 100%, 1/5 etc)
100%

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