Quickstart-unity: Unity Editor crashes when calling SetValueAsync with large string

Created on 26 May 2020  路  3Comments  路  Source: firebase/quickstart-unity

Please fill in the following fields:

Unity editor version:
Firebase Unity SDK version: 2019.3.3f1 (Windows)
Source you installed the SDK (.unitypackage or Unity Package Manager): UPM
Firebase plugins in use (Auth, Database, etc.): Database, Auth
Additional SDKs you are using (Facebook, AdMob, etc.): None
Platform you are using the Unity editor on (Mac, Windows, or Linux): Windows
Platform you are targeting (iOS, Android, and/or desktop): Android
Scripting Runtime (Mono, and/or IL2CPP): IL2CPP

Please describe the issue here:

(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)
Unity Editor crashes every time SetValueAsync is called with a large string.

Please answer the following, if applicable:

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)?
Yes, open quickstarts-unity project, edit UIHandler.cs script:
Change line 156 from:
newScoreMap["score"] = score;
to
newScoreMap["score"] = INSERT_VERY_LONG_STRING HERE (see pastebin);

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

This works as intended Android device but crashes inside Unity Editor.

database bug

Most helpful comment

Duplicate of #517

Unfortunately we do not have a proper fix for this yet. But I'll try to escalate for this.

All 3 comments

Hi @Whyser,

I tried to reproduce locally but I could not. I was testing on macOS, Unity version 2019.3.14f1, in editor.

First I attempted to copy and paste a large part of your example string but my text editor crashed. So I attempted a smaller subset, still crashed. Finally I decided to make a loop to assemble a string of length 75k characters through concatenation. The transaction completes successfully and the score is retreived successfully.

Could this be a problem in the C# Unity runtime with the static string coming from source? Could you test a assembled string of the same length to see if it, too, crashes?

Hey Della, thanks for confirming!
I actually didn't have it as a static string initially (and it failed anyway). But I just restarted my computer and now it works as it should :S.
Really sorry to have wasted your time, but it truly did crash quickstart example and using short string did work as intended.

EDIT:
Nope, it still crashes, I just accidentaly got a much shorter string (and didnt double check). I receive this string by doing:
JsonConvert.SerializeObject(EncryptedPlayerPrefs.CachedPlayerPrefs, Formatting.None).ToBase64String();

Where EncryptedPlayerPrefs.CachedPlayerPrefs is of type: Dictionary<string, object>

Gonna ping you here @DellaBitta in case you missed that I opened it up again.

Duplicate of #517

Unfortunately we do not have a proper fix for this yet. But I'll try to escalate for this.

Was this page helpful?
0 / 5 - 0 ratings