GodotNuts / GodotFirebase

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

[BUG] task_error signal unable to convert argument from int to String #315

Closed Tailchakra closed 3 months ago

Tailchakra commented 1 year ago

Describe the bug The addon is unable to convert an argument type during a query call on a collection. Authenticating works like a charm, however calling a collection returns the error upon query.from.

Expected behavior I expected to grab the skill tree data from the database, instead it returned an error.

To Reproduce

func _ready():
    Firebase.Auth.connect("login_succeeded", self, "_on_login_succeeded")
    Firebase.Auth.connect("login_failed", self, "on_login_failed")
    Firebase.Auth.login_with_email_and_password(auth_email, auth_password)

func GetSkillTree():
    var query = FirestoreQuery.new()
    query.from("skill_tree", false)
    var result = yield(Firebase.Firestore.query(query), "result_query")

    print(result)

func _on_login_succeeded(_auth):
    yield(GetSkillTree(), "completed")

image

Environment:

Additional context ADD: I have cache turned OFF

E 0:00:07.956   emit_signal: Error calling method from signal 'task_error': 'Node(firestore.gd)::_on_task_error': Cannot convert argument 2 from int to String..
  <C++ Source>  core/object.cpp:1242 @ emit_signal()
  <Stack Trace> firestore_task.gd:170 @ emit_error()
                firestore_task.gd:155 @ _on_request_completed()
                firestore.gd:303 @ _pooled_request()
                firestore.gd:153 @ query()
                Database.gd:28 @ GetSkillTree()
                Database.gd:227 @ _on_login_succeeded()
                auth.gd:416 @ _on_FirebaseAuth_request_completed()
BearDooks commented 1 year ago

@Tailchakra Thanks for submitting this. I will be testing over the next week and let you know what I find

WolfgangSenff commented 3 months ago

I have resolved this through a very long path - namely, I have done a huge refactor of the entire Firestore codebase to remove FirestoreTask altogether (from public usage). Please see this guide for more on how to approach something like the above, and apologies it took me so long to get the fix in! This refactor has been a long time in coming.

https://github.com/GodotNuts/GodotFirebase/wiki/Upgrade-Guide-to-4.x-version-2