GodotNuts / GodotFirebase

Implementations of Firebase for Godot using GDScript
MIT License
532 stars 76 forks source link

[BUG] bad "error" signal connection in firestore_collection #163

Closed ReneHabermann closed 3 years ago

ReneHabermann commented 3 years ago

Describe the bug When an error occurs while trying to add a document to a firestore collection (like a 403 authentication error), an error in Godot is produced, stating this:

E 0:00:04.610   Object::emit_signal: Error calling method from signal 'error': 'Reference(firestore_collection.gd)::_on_error': Method expected 3 arguments, but called with 1..
  <C++ Source>  core\object.cpp:1260 @ Object::emit_signal()
  <Stack Trace> firestore_task.gd:155 @ _on_request_completed()
                firestore.gd:359 @ _on_pooled_request_completed()

firestore_task.gd:155 emits the "error" signal with one parameter. In firestore_collection.gd:117 i think the signal is connected to the _on_error method. The _on_error method is in firestore_collection.gd:148, expecting 3 parameters.

To Reproduce Run Firebase.Firestore.collection("mycollection").add("", {"data":"mydata"}) on a collection you don't have write access to.

Expected behavior The method which is connected to the error signal should be called properly, and itself emit a signal. At least there shouldn't be an error occuring in Godot.

Environment:

I love your work, a joy to work with! :)

WolfgangSenff commented 3 years ago

We actually have a solution for this already with a branch that's ready to go, but have been discussing a more complete fix because the original code was being used in multiple places (that's the problem) instead of being properly separated. It should be resolved by #161 .

WolfgangSenff commented 3 years ago

Resolved by #162 .