Skip to content

[BUG] Firebase.Auth.auth_request returning array of strings on error but line 172 in firestore_collection.gd expects int #495

Description

@divinewind420

Describe the bug
Attempting to load collection, but received error, but instead of error message, program threw error and halted.
Firebase.Auth.auth_request returning array of strings but line 172 in firestore_collection.gd expects int

	if result[0] != 1:
		Firebase.Firestore._check_auth_error(result[0], result[1])
		return

To Reproduce
Steps to reproduce the behavior:

Attempt to load collection, but get an error. If there is an issue then auth_request returns 'result' as strings, causing the check in firestore_collection.gd to fail. If there is no issue getting a collection then auth_request returns 'result' containing an int as expected by firestore_collection.gd.

Code works if collection loads as normal but if there is an issue, will generate crash in firestore_collection :

func load_data():
var auth = Firebase.Auth.auth
if auth.localid:
var collection: FirestoreCollection = Firebase.Firestore.collection(COLLECTION_ID)

	var document = await collection.get_doc(auth.localid)

Expected behavior
A clear and concise description of what you expected to happen, for example:

Should either load collection or advise via return value or console that error was received.

Screenshots
Added screenshot to help explain your problem.

Environment:

  • OS: Windows 10
  • Browser Firefox

Additional context
Godot 4,.4 &
Godot 4.6.1

Image Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions