firebase / firebase/firebase-unity-sdk

[Bug] Error caught by debugger on each recompile when in play mode

Open
#1,049 6 comments 0 reactions 0 assignees View on GitHub
api: firestore type: bug
Dominant language
C#
Stars
320
Forks
60
Avg merge
13h 32m
Merged PRs (30d)
13

Description

### Description

When my debugger (Rider) is connected, each time Unity recompiles due to code being edited while Unity is running, the follow exception is thrown. This makes it very annoying to leave my debugger attached.

System.ArgumentNullException: "_p_firebase__firestore__csharp__TransactionManager" has been disposed
at Firebase.Firestore.TransactionManagerProxy.CppDispose () [0x00016] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/linux_unity/firestore/swig/Firebase.Firestore_fixed.cs:3644
at Firebase.Firestore.TransactionManager.Dispose () [0x0000d] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/firestore/src/TransactionManager.cs:63
at Firebase.Firestore.FirebaseFirestore.Dispose () [0x0004c] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/firestore/src/FirebaseFirestore.cs:96
at Firebase.Firestore.FirebaseFirestore.Finalize () [0x00002] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/firestore/src/FirebaseFirestore.cs:76

### Reproducing the issue

Run your project, connect your debugger, change some code to force unity to compile.

### Firebase Unity SDK Version

12

### Unity editor version

2022.x.x

### Installation Method

.unitypackage

### Problematic Firebase Component(s)

Firestore

### Other Firebase Component(s) in use

Firestore

### Additional SDKs you are using

_No response_

### Targeted Platform(s)

Apple Platforms

### Unity editor platform

Mac

### Scripting Runtime

IL2CPP

### Release Distribution Type

Pre-built SDK from https://firebase.google.com/download/unity

### Relevant Log Output

```shell
System.ArgumentNullException: "_p_firebase__firestore__csharp__TransactionManager" has been disposed
at Firebase.Firestore.TransactionManagerProxy.CppDispose () [0x00016] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/linux_unity/firestore/swig/Firebase.Firestore_fixed.cs:3644
at Firebase.Firestore.TransactionManager.Dispose () [0x0000d] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/firestore/src/TransactionManager.cs:63
at Firebase.Firestore.FirebaseFirestore.Dispose () [0x0004c] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/firestore/src/FirebaseFirestore.cs:96
at Firebase.Firestore.FirebaseFirestore.Finalize () [0x00002] in /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/firestore/src/FirebaseFirestore.cs:76
```

### If using CocoaPods for Apple platforms, the project's Podfile.lock

Expand Podfile.lock snippet

```yml

👀 Replace this line with the contents of your Podfile.lock!

```

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by running the Unity project with Rider attached, editing code, and forcing a recompile. Start with firestore/src/TransactionManager.cs and firestore/src/FirebaseFirestore.cs, then inspect the Firebase.Firestore_fixed.cs stack location; done means recompilation no longer produces the disposed TransactionManager exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, firebase, unity
Domain
databases, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.