GodotNuts / GodotFirebase

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

[BUG] crash when not connected to internet #245

Closed shafnaz closed 2 years ago

shafnaz commented 2 years ago

Describe the bug When your not connected to the internet, and you perform a task i.e. sending data to Firestore Database, the app crashes.

To Reproduce Disable internet before submitting firebask task.

func upload_new_item(data : Dictionary):
    var firestore_collection : FirestoreCollection = Firebase.Firestore.collection(firestore_collection_id)
    var document_id = "document_id"
    var fields = data
    var add_task : FirestoreTask = firestore_collection.add(document_id, fields)
    var added_item : FirestoreDocument = yield(add_task, "task_finished")
    return added_item

Expected behavior

print(err code: Connection error   Error connecting to auth service)
return err

or something like that

Screenshots image

Environment:

Additional context Add any other context about the problem here.

BearDooks commented 2 years ago

@shafnaz thanks for bring this to our attention. I will take a look at it and let them team know what I find.

Thanks

Chuck

BearDooks commented 2 years ago

@shafnaz I was finally able to test this and I am not seeing the same as you. I disabled the NIC on my machine so I could truly test this, and I am getting an error about not being able to connect to the auth service.

image

Can you confirm you are running the latest version of the plugin?

Chuck

shafnaz commented 2 years ago

Hi @BearDooks, image image image

I added a print line there as you can see. I am using the latest version, also re-added the plugin to be sure.

BearDooks commented 2 years ago

@shafnaz I am curious. Are you waiting to see if a user is logged in before you move onto the next step, or in your code do you log in, and then go right into running commands on Firebase?

I think this is where our disconnect may be, and why I am seeing something different. As an example, in the Test harness we use, I tell the user to log in, and then on successful login the app moves on, if they don't log in or something else happens, the app stops processing and waits.

Thanks

Chuck

BearDooks commented 2 years ago

@shafnaz any update on this?

Thanks

Chuck

shafnaz commented 2 years ago

well I just log in like this: image I disable my connection to wifi, and then run the project

BearDooks commented 2 years ago

OK. Can you break that code down for me since it does not look like the normal code we run.

I can only assume userinfo is another node somewhere?

Thanks

Chuck

shafnaz commented 2 years ago

Oh, right. Sorry about that. image

pretty straight forward

BearDooks commented 2 years ago

What happens after that 4 second yield time. Can you share more of the code?

shafnaz commented 2 years ago

Well nothing relating to log in, I create a document after that. I just give it some space. The issue still happens even if I remove any code after that.

shafnaz commented 2 years ago

image

shafnaz commented 2 years ago

hold on, I'm getting something else. I removed the login code, I still get the error, it's coming from something else

shafnaz commented 2 years ago

Alright let's close this issue, The error is coming from a scene. _process is running a code